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

fix repeat 0-dim tensor bug #6150

Merged
merged 8 commits into from
Sep 3, 2021
3 changes: 3 additions & 0 deletions python/oneflow/nn/modules/repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def repeat_op(input, *sizes):
flow.Size([1, 3, 2, 4])
"""

if input.ndim == 0 and input.numel() == 1:
input = input.unsqueeze(0)

if _input_args_is_int(sizes):
sizes = _single(sizes)
elif _input_args_is_tuple_int(sizes):
Expand Down