tkonolige commented on a change in pull request #8085:
URL: https://github.com/apache/tvm/pull/8085#discussion_r637048155



##########
File path: python/tvm/topi/random/kernel.py
##########
@@ -306,7 +309,10 @@ def gen_ir(gen_ptr, out_gen_ptr, out_array_ptr):
         out_gen[4] = tmp[4]  # path stays the same
         out_gen[5] = tmp[5]
         out_gen[6] = tir.const(0, dtype=gen.dtype)  # unused, leave it as 0
-        out_gen[7] = tmp[7] + tir.Cast(gen.dtype, out_len)  # increment counter
+        with irb.if_scope(out_len % 4 != 0):
+            out_gen[7] = tmp[7] + tir.Cast(gen.dtype, out_len % 4)
+        with irb.else_scope():
+            out_gen[7] = tmp[7] + tir.Cast(gen.dtype, out_len)  # increment 
counter

Review comment:
       Oh yeah, you are correct. Could you leave a comment that it was updated 
earlier.




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


Reply via email to