Skip to content

Commit

Permalink
Remove HasValueSemantics from is ops.
Browse files Browse the repository at this point in the history
  • Loading branch information
silvasean authored and gpetters94 committed Jul 27, 2022
1 parent 9b36420 commit d4855b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -7596,7 +7596,6 @@ def Torch_AtenNeBoolOp : Torch_Op<"aten.ne.bool", [

def Torch_Aten__Is__Op : Torch_Op<"aten.__is__", [
AllowsTypeRefinement,
HasValueSemantics,
ReadOnly
]> {
let summary = "Generated op for `aten::__is__ : (t1, t2) -> (bool)`";
Expand All @@ -7621,7 +7620,6 @@ def Torch_Aten__Is__Op : Torch_Op<"aten.__is__", [

def Torch_Aten__Isnot__Op : Torch_Op<"aten.__isnot__", [
AllowsTypeRefinement,
HasValueSemantics,
ReadOnly
]> {
let summary = "Generated op for `aten::__isnot__ : (t1, t2) -> (bool)`";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ def has_value_semantics(self):
# but the alias annotation is empty.
if self.unique_key == "prim::unchecked_cast : (t) -> (t)":
return False
# The `is` operator compares object identity, so it does not have
# value semantics.
if self.unique_key in ("aten::__is__ : (t1, t2) -> (bool)",
"aten::__isnot__ : (t1, t2) -> (bool)"):
return False
return True

def is_readonly(self):
Expand Down

0 comments on commit d4855b4

Please sign in to comment.