Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/arm/_passes/match_where_self_arg_dtype_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def call(self, graph_module: torch.fx.GraphModule):

input_dtype = input_.meta["val"].dtype
other_dtype = other_.meta["val"].dtype
target_dtype = torch.float32
target_dtype = input_dtype
if input_dtype != other_dtype:
target_dtype = get_largest_dtype(input_dtype, other_dtype)

Expand Down
7 changes: 7 additions & 0 deletions backends/arm/test/ops/test_where.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def scalar_condition(input: torch.Tensor):
scalar_condition,
)

int32_scalar_cond = Where(
1,
torch.int32,
scalar_condition,
)

test_modules_common = {
"two_dim_tensor_cond": lambda: two_dim_tensor_cond,
"three_dim_tensor_cond": lambda: three_dim_tensor_cond,
Expand All @@ -134,6 +140,7 @@ def scalar_condition(input: torch.Tensor):
**test_modules_common,
"float32_tensor_cond_tuple_dtype": lambda: float32_tensor_cond_tuple_dtype,
"float32_tensor_cond_tuple_dtype_bool": lambda: float32_tensor_cond_tuple_dtype_bool,
"int32_scalar_cond": lambda: int32_scalar_cond,
}

test_modules_BI = {
Expand Down
Loading