diff --git a/tao_compiler/mlir/disc/transforms/disc_lower_to_library_call.cc b/tao_compiler/mlir/disc/transforms/disc_lower_to_library_call.cc old mode 100644 new mode 100755 index bd6b7296dd2..a3de94b8677 --- a/tao_compiler/mlir/disc/transforms/disc_lower_to_library_call.cc +++ b/tao_compiler/mlir/disc/transforms/disc_lower_to_library_call.cc @@ -494,7 +494,7 @@ struct TransposeConverter : public OpRewritePattern { if (rank != 2 && rank != 3) return failure(); // only rewriter custom library when switch 1 and 2 dimensions of // a 3d tensor, that means permute = [0, 2, 1] - if (rank == 3 && permutation[1] != 2 && permutation[2] != 1) + if (rank == 3 && (permutation[1] != 2 || permutation[2] != 1)) return failure(); bool on_gpu = placement_utils::isGpuMemRef(op->getOperand(0)); // TODO: support other device @@ -914,8 +914,7 @@ struct DiscLowerToLibraryCallPass SendOutputOpConvertor >(context); // clang-format on - if (enableTransposeLibraryCall()) - patterns.insert(context); + patterns.insert(context); // GPU copy related ops patterns.insert>(context, "h2d");