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

Error RuntimeError: 2D tensors expected, got 1D #3

Open
kayuksel opened this issue Mar 3, 2019 · 1 comment
Open

Error RuntimeError: 2D tensors expected, got 1D #3

kayuksel opened this issue Mar 3, 2019 · 1 comment

Comments

@kayuksel
Copy link

kayuksel commented Mar 3, 2019

I am trying to integrate meProp into my work, but getting such error. Do you have any idea about this?

    return linearUnified(self.k)(x, self.w, self.b)
 line 39, in forward
    y.addmm_(0, 1, x, w)
RuntimeError: 2D tensors expected, got 1D, 2D tensors at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:258
@jklj077
Copy link
Collaborator

jklj077 commented Mar 4, 2019

Hi~ I'm not very sure, but it seems that the input tensor (x) is 1D now. The provided code assumes batched input of size [batch_size, hidden_size]. I think expanding it to 2D should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants