Skip to content

Commit

Permalink
fix for avoiding Buffer.vload(...) case
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed May 17, 2022
1 parent 54c6864 commit ad9b053
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/tvm/script/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use for error reporting.
"""
# pylint: disable=invalid-name, inconsistent-return-statements, no-else-return
import types
import json
import operator
import inspect
Expand Down Expand Up @@ -580,10 +581,14 @@ def transform_Assign(self, node):
arg_list = self.parse_arg_list(func, node.rhs)
func.handle(node, self.context, arg_list, node.rhs.func_name.span)
return self.parse_body(node)
elif callable(func):
elif isinstance(func, types.FunctionType):
# Pattern 5
args = [self.transform(arg) for arg in node.rhs.params]
out = func(*args)

if len(node.lhs) == 1 and not isinstance(out, list):
out = [out]

assert len(out) == len(node.lhs)

for var, value in zip(node.lhs, out):
Expand Down

0 comments on commit ad9b053

Please sign in to comment.