mirror of https://github.com/llvm/torch-mlir
Remove HasValueSemantics from `is` ops.
parent
d70bb68c9e
commit
795479a88d
|
@ -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)`";
|
||||
|
@ -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)`";
|
||||
|
|
|
@ -251,6 +251,11 @@ class JitOperator:
|
|||
# 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):
|
||||
|
|
Loading…
Reference in New Issue