tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] jwfromm commented on a change in pull request #5174: [Torch] Add support for split
Date Mon, 30 Mar 2020 17:59:55 GMT
jwfromm commented on a change in pull request #5174: [Torch] Add support for split
URL: https://github.com/apache/incubator-tvm/pull/5174#discussion_r400371382
 
 

 ##########
 File path: python/tvm/relay/frontend/pytorch.py
 ##########
 @@ -105,6 +105,36 @@ def _impl(inputs, input_types):
         return _op.transform.strided_slice(data, begin, end, strides)
     return _impl
 
+def _split():
+    def _impl(inputs, input_types):
+        data = inputs[0]
+        split_size = int(inputs[1])
+        dim = int(inputs[2])
+
+        now_indice = split_size
+        indices = []
+        while now_indice < _infer_shape(data)[dim]:
+            indices.append(now_indice)
+            now_indice += split_size
+
+        return _op.split(data, indices, dim)
+    return _impl
+
+def _split_with_sizes():
+    def _impl(inputs, inputs_types):
+        data = inputs[0]
+        dim = int(inputs[2])
+
+        now_indice = 0
 
 Review comment:
   A better name for this variable would be `split_index`.

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


With regards,
Apache Git Services

Mime
View raw message