File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1870,7 +1870,7 @@ def __eq__(self, other):
18701870 if self .value .aval != other .value .aval :
18711871 return False
18721872 if self .data is None :
1873- return id ( self ) == id ( other )
1873+ return self is other
18741874 return self .data == other .data
18751875
18761876
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ def __reduce__(self):
286286 def __eq__ (self , other ):
287287 # This is a performance optimization. Comparing thousands of devices
288288 # can be expensive.
289- if id ( self ) == id ( other ) :
289+ if self is other :
290290 return True
291291 if not isinstance (other , Mesh ):
292292 return False
@@ -454,7 +454,7 @@ def __hash__(self):
454454 return self ._hash
455455
456456 def __eq__ (self , other ):
457- if id ( self ) == id ( other ) :
457+ if self is other :
458458 return True
459459 if not isinstance (other , AbstractMesh ):
460460 return False
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def __hash__(self) -> int:
4040 return hash (self .dtype .type )
4141
4242 def __eq__ (self , other : Any ) -> bool :
43- return id ( self ) == id ( other ) or self .dtype .type == other
43+ return self is other or self .dtype .type == other
4444
4545 def __ne__ (self , other : Any ) -> bool :
4646 return not (self == other )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def is_op_sharding_replicated(op: xc.OpSharding | xc.HloSharding) -> bool:
5555
5656def are_op_shardings_equal (op1 : xc .OpSharding | xc .HloSharding ,
5757 op2 : xc .OpSharding | xc .HloSharding ) -> bool :
58- if id ( op1 ) == id ( op2 ) :
58+ if op1 is op2 :
5959 return True
6060 if is_op_sharding_replicated (op1 ) and is_op_sharding_replicated (op2 ):
6161 return True
You can’t perform that action at this time.
0 commit comments