shengxinhu commented on a change in pull request #9329:
URL: https://github.com/apache/tvm/pull/9329#discussion_r734382014



##########
File path: include/tvm/topi/transform.h
##########
@@ -1776,12 +1775,10 @@ inline Tensor matrix_set_diag(const Tensor& input, 
const Tensor& diagonal, int k
           for (size_t i = 0; i < ndim - 1; i++) {
             diagonal_indices.push_back(iter_vars[i]);
           }
-          if (only_one_diagonal) {
-            k = k1;
-          } else {
+          auto multi_diagonals = [&]() {
             // Determining which diagonal/sub-diagonal/super-diagonal it is
             k = iter_vars[ndim] - iter_vars[ndim - 1];
-            diagonal_indices.push_back(k2 - k);
+            diagonal_indices.push_back(k2(0) - k);

Review comment:
       ok




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