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 2019/11/15 16:35:39 UTC

[GitHub] [incubator-tvm] abergeron commented on a change in pull request #4303: [TOPI][Relay][OP] Add a strided_set operation.

abergeron commented on a change in pull request #4303: [TOPI][Relay][OP] Add a strided_set operation.
URL: https://github.com/apache/incubator-tvm/pull/4303#discussion_r346909365
 
 

 ##########
 File path: python/tvm/relay/op/_transform.py
 ##########
 @@ -304,6 +305,31 @@ def compute_argwhere(attrs, inputs, output_type, _):
     new_output_type = tvm.relay.ty.TensorType(output_shape, "int32")
     return [topi.argwhere(new_output_type, inputs[0])]
 
+@_reg.register_compute("strided_set")
+def compute_strided_set(attrs, inputs, output_type, _):
+    """Compute definition of strided_set"""
+    begin = attrs.begin
+    end = attrs.end
+    strides = attrs.strides
+    n = len(inputs[0].shape)
+    ls = len(strides)
+    if ls < n:
+        strides = list(strides)
+        strides[ls:] = [1] * (n - ls)
 
 Review comment:
   Done.

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