mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[MPSInductor][EZ] Fix logical_[or|end] ops (#144122)
For boolean operands it does not really matter whether `&` or `&&` is used, but if one ever to rely on operator precedence, then bitwise ops should have higher precendence than logical ones Pull Request resolved: https://github.com/pytorch/pytorch/pull/144122 Approved by: https://github.com/huydhn ghstack dependencies: #144055, #144051
This commit is contained in:
committed by
PyTorch MergeBot
parent
b336d72dae
commit
f7644efa79
@ -75,11 +75,11 @@ class MetalOverrides(OpOverrides):
|
||||
|
||||
@staticmethod
|
||||
def logical_or(a: CSEVariable, b: CSEVariable) -> str:
|
||||
return f"{a} | {b}"
|
||||
return f"{a} || {b}"
|
||||
|
||||
@staticmethod
|
||||
def logical_and(a: CSEVariable, b: CSEVariable) -> str:
|
||||
return f"{a} & {b}"
|
||||
return f"{a} && {b}"
|
||||
|
||||
@staticmethod
|
||||
def abs(x: CSEVariable) -> str:
|
||||
|
Reference in New Issue
Block a user