jwfromm commented on a change in pull request #10873:
URL: https://github.com/apache/tvm/pull/10873#discussion_r840926853



##########
File path: src/relay/op/tensor/transform.cc
##########
@@ -3880,9 +3866,11 @@ RELAY_REGISTER_OP("matrix_set_diag")
         **sub_diag_right_align** Bool, true iff sub-diagonal is right aligned 
(left-padded).
     )code" TVM_ADD_FILELINE)
     .set_attrs_type<MatrixSetDiagAttrs>()
-    .set_num_inputs(2)
+    .set_num_inputs(4)
     .add_argument("input", "Tensor", "Input Tensor.")
     .add_argument("diagonal", "Tensor", "Values to be filled in the diagonal.")
+    .add_argument("k1", "Tensor", "ILower limit (included) of the range of 
diagonals.")

Review comment:
       Small typo here "ILower" -> "Lower"

##########
File path: tests/python/topi/python/test_topi_transform.py
##########
@@ -1240,9 +1257,6 @@ def test_sparse_to_dense():
 @tvm.testing.uses_gpu
 def test_matrix_set_diag():
     for dtype in ["float32", "int32"]:
-        verify_matrix_set_diag((2, 2), (2,), dtype)
-        verify_matrix_set_diag((4, 3, 3), (4, 3), dtype)
-        verify_matrix_set_diag((2, 3, 4), (2, 3), dtype, 1)

Review comment:
       Just curious, why are these tests removed?

##########
File path: tests/python/topi/python/test_topi_transform.py
##########
@@ -752,21 +752,38 @@ def check_device(target, dev):
 def verify_matrix_set_diag(input_shape, diagonal_shape, dtype, k=0, 
align="RIGHT_LEFT"):
     input = te.placeholder(shape=input_shape, name="input", dtype=dtype)
     diagonal = te.placeholder(shape=diagonal_shape, name="diagonal", 
dtype=dtype)
-    matrix_set_diag_result = topi.transform.matrix_set_diag(input, diagonal, 
k, align)
+    k1 = te.placeholder(shape=(1,), name="k1", dtype="int64")
+    k2 = te.placeholder(shape=(1,), name="k2", dtype="int64")
+    matrix_set_diag_result = topi.transform.matrix_set_diag(input, diagonal, 
(k1, k2), align)
+
+    k_one, k_two = None, None
+    if isinstance(k, (tuple, list)):

Review comment:
       Can you add some comments to this test? It's a little hard to follow.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to