From 5393581f5fbf11a4c80d0e850760a14b19d5c36f Mon Sep 17 00:00:00 2001 From: Eashan Garg Date: Thu, 2 Oct 2025 13:54:46 -0700 Subject: [PATCH] Fix Wav2Vec Replace Pass Bug Summary: https://www.internalfb.com/intern/test/844425152545113 Bug with ReplaceLogicalNotBooleanWhereWithWherePass inputs that aren't tensors Reviewed By: ethansfng Differential Revision: D83778606 --- backends/cadence/aot/replace_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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