tqchen commented on a change in pull request #5077: [Refactor][Relay] Refactor 
Relay Python to use new FFI
URL: https://github.com/apache/incubator-tvm/pull/5077#discussion_r393232602
 
 

 ##########
 File path: python/tvm/relay/op/op_attrs.py
 ##########
 @@ -16,314 +16,326 @@
 # under the License.
 """The attributes node used for Relay operators"""
 
+import tvm._ffi
 from tvm.ir import Attrs
-from ..base import register_relay_attr_node
 
 
-@register_relay_attr_node
+def _register_relay_attr_node(type_key=None):
+    """Register a Relay attribute node.
+
+    Parameters
+    ----------
+    type_key : str or cls
+        The type key of the node.
+    """
+    return tvm._ffi.register_object(
+        "relay.attrs." + type_key.__name__)(type_key)
+
+
+@_register_relay_attr_node
 class Conv1DAttrs(Attrs):
     """Attributes for nn.conv1d"""
 
 
-@register_relay_attr_node
 
 Review comment:
   consider to use tvm._ffi.register_object directly(and provide the type key), 
this way FFI navigator can work to help users to navigate across code boundaries

----------------------------------------------------------------
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

Reply via email to