diff --git a/backends/cadence/aot/replace_ops.py b/backends/cadence/aot/replace_ops.py index 9e95460f2f5..2104764cd14 100644 --- a/backends/cadence/aot/replace_ops.py +++ b/backends/cadence/aot/replace_ops.py @@ -89,10 +89,10 @@ def replace_logical_nop_where_with_where( # Get the third arg node and its input logical_not_node = node.args[0] - logical_not_input_tensor = logical_not_node.args[0].to_tensor() + logical_not_input_node = logical_not_node.args[0] # If the logical_not input is not a boolean tensor, bail. - if logical_not_input_tensor.meta["spec"].dtype != torch.bool: + if logical_not_input_node.meta["val"].dtype != torch.bool: continue # Replace the where op with another one, flipping the inputs and using the boolean