gemini-code-assist[bot] commented on code in PR #19588:
URL: https://github.com/apache/tvm/pull/19588#discussion_r3266531541


##########
src/relax/transform/reorder_permute_dims_after_concat.cc:
##########
@@ -151,6 +151,20 @@ std::tuple<DFPattern, ffi::TypedFunction<Expr(Expr, 
ffi::Map<DFPattern, Expr>)>>
     auto concat_attrs = concat_call->attrs.as<ConcatAttrs>();
     TVM_FFI_ICHECK(concat_attrs);
 
+    auto permute_dims_axes = get_permute_dims_axes(all_permute_dims[0]);
+  
+    int64_t old_concat_axis = concat_attrs->axis.value_or(0);
+    int64_t ndim = static_cast<int64_t>(permute_dims_axes.size());
+    if (old_concat_axis < 0) {
+      old_concat_axis += ndim;
+    }
+    TVM_FFI_ICHECK_GE(old_concat_axis, 0) << "concat axis " << old_concat_axis
+                                          << " out of range for " << ndim << 
"-D input";
+    TVM_FFI_ICHECK_LT(old_concat_axis, ndim) << "concat axis " << 
old_concat_axis
+                                             << " out of range for " << ndim 
<< "-D input";
+
+    Integer new_concat_axis = 
permute_dims_axes[static_cast<size_t>(old_concat_axis)];

Review Comment:
   ![critical](https://www.gstatic.com/codereviewagent/critical.svg)
   
   This change introduces a compilation error because it adds a new 
implementation for axis normalization (lines 154-166) but fails to remove the 
original implementation (lines 168-169 in the updated file). This results in a 
redefinition of `old_concat_axis` and `new_concat_axis` within the same scope, 
which is not allowed in C++. Please ensure the old implementation is removed so 
that the new logic correctly replaces it.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to