Skip to content

Commit 3ca809f

Browse files
committed
Fix style issues in op_registry.py
1 parent c2286ae commit 3ca809f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

backends/vulkan/op_registry.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -387,21 +387,21 @@ def check_reduce_node(node: torch.fx.Node) -> bool:
387387
if memory_layout is not None:
388388
for dim in dim_list:
389389
# For WIDTH_PACKED layout, dimension 3 (W) is packed
390-
if (
391-
memory_layout == VkMemoryLayout.TENSOR_WIDTH_PACKED
392-
and dim == 3
393-
):
394-
return False
395390
# For HEIGHT_PACKED layout, dimension 2 (H) is packed
396-
elif (
397-
memory_layout == VkMemoryLayout.TENSOR_HEIGHT_PACKED
398-
and dim == 2
399-
):
400-
return False
401391
# For CHANNELS_PACKED layout, dimension 1 (C) is packed
402-
elif (
403-
memory_layout == VkMemoryLayout.TENSOR_CHANNELS_PACKED
404-
and dim == 1
392+
if (
393+
(
394+
memory_layout == VkMemoryLayout.TENSOR_WIDTH_PACKED
395+
and dim == 3
396+
)
397+
or (
398+
memory_layout == VkMemoryLayout.TENSOR_HEIGHT_PACKED
399+
and dim == 2
400+
)
401+
or (
402+
memory_layout == VkMemoryLayout.TENSOR_CHANNELS_PACKED
403+
and dim == 1
404+
)
405405
):
406406
return False
407407
except (AssertionError, KeyError, AttributeError):

0 commit comments

Comments
 (0)