You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/09 02:53:51 UTC

[GitHub] [incubator-tvm] areusch commented on a change in pull request #6020: [Relay][Frontend][Onnx] GRU Layer Support

areusch commented on a change in pull request #6020:
URL: https://github.com/apache/incubator-tvm/pull/6020#discussion_r451934374



##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -1530,6 +1532,14 @@ def _activation_needs_beta(cls, activation):
 
     @classmethod
     def _impl_v7(cls, inputs, attr, params):
+        if cls.name == 'LSTM':

Review comment:
       here I think it'd be cleaner to just implement the `@classmethod` in each subclass, no?

##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -1530,6 +1532,14 @@ def _activation_needs_beta(cls, activation):
 
     @classmethod
     def _impl_v7(cls, inputs, attr, params):
+        if cls.name == 'LSTM':
+            return cls._lstm(inputs, attr, params)
+        if cls.name == 'GRU':
+            return cls._gru(inputs, attr, params)
+        raise NotImplementedError("%s RNNs are not yet supported." % cls.name)
+
+    @classmethod
+    def _lstm(cls, inputs, attr, params):

Review comment:
       any reason not to move this to LSTM subclass?




----------------------------------------------------------------
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:
users@infra.apache.org