Skip to content

Commit 29411f8

Browse files
committed
Skip no-op slicing op
1 parent 6dc7eb4 commit 29411f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torch_ttnn/passes/lowering/to_tt_pass.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,15 @@ def rewrite_node(node):
554554
return None
555555

556556
if node.target == torch.ops.aten.slice.Tensor:
557+
557558
def callback(tensor, dim, start, end, step=1):
558559
input_size = tensor.meta["val"].size()
559560

560561
if step != 1 or dim >= len(input_size):
561562
return None
562563

563-
# NOTE(jdh8): is there a way to skip a no-op?
564-
# if start == 0 and end >= input_size[dim]:
565-
# return tensor
564+
if start == 0 and end >= input_size[dim]:
565+
return tensor
566566

567567
if len(input_size) != 4:
568568
return None

0 commit comments

Comments
 (0)