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 2021/10/22 09:28:05 UTC

[GitHub] [tvm] shengxinhu commented on a change in pull request #9329: [Relay/TOPI][ONNX/TFLite] Refactor MATRIX_SET_DIAG Operator for Relay…

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org