zhiics 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_r364382587
##########
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:
Yes, I tried it, but it looked to me that we have to merge nodebase to
object first before I can use object directly as there are fields not
implemented in object, like getattr, etc. Should I use nodebase first then we
can refactor them together?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services