Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates conversion of torch.expand to ttnn.repeat to allow repeating on last dimension. #803

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions tests/models/mobilenet_ssd/test_mobilenet_ssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def _load_inputs(self):
"mode",
["eval"],
)
@pytest.mark.converted_end_to_end
def test_mobilenet_ssd(record_property, mode):
model_name = "MobileNetSSD"
record_property("model_name", model_name)
Expand Down
3 changes: 1 addition & 2 deletions torch_ttnn/passes/lowering/to_tt_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,7 @@ def reshape_1d(code, args=args, kwargs=kwargs):
# aten.expand and ttnn.repeat has different meaning for their `shape` argument
# aten.expand: the desired output shape, where respective singleton dims are broadcasted
# ttnn.repeat: the number of times to repeat a respective singleton dim
# Repeat fails if last dimension of input is 1
if input_tensor_shape[-1] != 1 and len(input_tensor_shape) == len(output_shape):
if len(input_tensor_shape) == len(output_shape):
return g.call_function(target_wrappers.repeat, args=(args[0], multiplier.tolist()))

return None
Expand Down