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

batch_first argument doesn’t work #51

Open
Trungmaster5 opened this issue Mar 13, 2020 · 1 comment
Open

batch_first argument doesn’t work #51

Trungmaster5 opened this issue Mar 13, 2020 · 1 comment

Comments

@Trungmaster5
Copy link

Hi,
I just want to let you know that with current implementation (file dnc.py, line 76:86), the batch_first will always be True. It is trivial but sometime troublesome.
Have a nice day.

@srikanthmalla
Copy link

srikanthmalla commented Mar 14, 2020

I think you might be right, when I set batch_first = True and I give input of shape bs x ts x n. I get this error with batch size (bs): 256
File "/home/root/pytorch/lib/python3.5/site-packages/dnc/dnc.py", line 223, in forward inputs = [T.cat([input[:, x, :], last_read], 1) for x in range(max_length)] File "/home/root/pytorch/lib/python3.5/site-packages/dnc/dnc.py", line 223, in <listcomp> inputs = [T.cat([input[:, x, :], last_read], 1) for x in range(max_length)] RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 256 and 1 in dimension 0 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:71
But when I permute my input to shape ts x bs x n and set batch_first = False, I do not get the error.

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