[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4643: [REFACTOR] Replace TensorObj and TensorValue with NDArray
tqchen commented on a change in pull request #4643: [REFACTOR] Replace TensorObj and TensorValue with NDArray URL: https://github.com/apache/incubator-tvm/pull/4643#discussion_r364363814 ## File path: python/tvm/relay/backend/interpreter.py ## @@ -23,27 +23,13 @@ from . import _backend from .. import _make, analysis, transform from .. import module -from ... import register_func, nd +from ... import nd from ..base import NodeBase, register_relay_node from ..expr import Tuple, RefCreate, Call, Constant, GlobalVar, Function, const from ..scope_builder import ScopeBuilder -from . import _vm - -class Value(NodeBase): -"""Base class of all values. -""" -@staticmethod -@register_func("relay.from_scalar") -def from_scalar(value, dtype=None): -"""Convert a Python scalar to a Relay scalar.""" -return TensorValue(const(value, dtype).data) - -def to_vm(self): -return _vm._ValueToVM(self) - @register_relay_node -class TupleValue(Value): +class TupleValue(NodeBase): Review comment: Let us inherit from Object for now, and have a subsequent PR to cleanup the python side. Also seems we might be able to use Array(or ADT, see discussion here https://discuss.tvm.ai/t/discuss-runtime-array-containers-array-adt-string/4582) for this after @wweic 's PR lands This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4643: [REFACTOR] Replace TensorObj and TensorValue with NDArray
tqchen commented on a change in pull request #4643: [REFACTOR] Replace TensorObj and TensorValue with NDArray URL: https://github.com/apache/incubator-tvm/pull/4643#discussion_r364363086 ## File path: python/tvm/relay/backend/interpreter.py ## @@ -23,27 +23,13 @@ from . import _backend from .. import _make, analysis, transform from .. import module -from ... import register_func, nd +from ... import nd from ..base import NodeBase, register_relay_node from ..expr import Tuple, RefCreate, Call, Constant, GlobalVar, Function, const from ..scope_builder import ScopeBuilder -from . import _vm - -class Value(NodeBase): -"""Base class of all values. -""" -@staticmethod -@register_func("relay.from_scalar") -def from_scalar(value, dtype=None): -"""Convert a Python scalar to a Relay scalar.""" -return TensorValue(const(value, dtype).data) - -def to_vm(self): -return _vm._ValueToVM(self) - @register_relay_node -class TupleValue(Value): +class TupleValue(NodeBase): Review comment: There is no Node anymore in the c++ side, see https://github.com/apache/incubator-tvm/pull/4603 and https://github.com/apache/incubator-tvm/issues/4647 So NodeBase was a legacy item that we might need to upgrade on the python side. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services