Skip to content

Solved RuntimeError: zero-dimensional tensor cannot be concatenated - #27

Open
Jean-Michel Amath Sarr (jmamath) wants to merge 2 commits into
microsoft:mainfrom
jmamath:main
Open

Solved RuntimeError: zero-dimensional tensor cannot be concatenated#27
Jean-Michel Amath Sarr (jmamath) wants to merge 2 commits into
microsoft:mainfrom
jmamath:main

Conversation

@jmamath

Copy link
Copy Markdown

When applying OTDD on a small dataset, it might happen that the last item of the labels might be of the form tensor(k) instead of tensor([k]) with k a torch.int64. In such case, it would produce the following error:
RuntimeError: zero-dimensional tensor (at position 1) cannot be concatenated.

To avoid that, I created a dumb dimension for the last item.

Solved "RuntimeError: zero-dimensional tensor (at position 1) cannot be concatenated"
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jmamath