Skip to content

Commit

Permalink
Fix to custom op lowering transform
Browse files Browse the repository at this point in the history
  • Loading branch information
rdadolf committed Jun 13, 2022
1 parent 357a335 commit a48a6a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/Conversion/TorchToLinalg/CustomOpExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class ConvertCustomOpExample
return failure();
// Since the example op does nothing, we simply replace the uses of the
// return value with its argument, then remove the op.
op->replaceAllUsesWith(op->getOperands());
op->erase();
rewriter.replaceOp(op, op->getOperands());

return success();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def uppercase_first_letter(s):
cpp_class_name = "".join(
uppercase_first_letter(s) for s in op_class_name_atoms) + "Op"
# Disallow leading underscores in C++ to avoid illegal names.
cpp_class_name = cpp_class_name.lstrip('_')
cpp_class_name = cpp_class_name.lstrip("_")
return op_name, cpp_class_name

def get_shape_function_signature(self):
Expand Down

0 comments on commit a48a6a4

Please sign in to comment.