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

Cannot use 0D tensor as int #33

Open
roastduck opened this issue Nov 4, 2020 · 1 comment
Open

Cannot use 0D tensor as int #33

roastduck opened this issue Nov 4, 2020 · 1 comment

Comments

@roastduck
Copy link

Please look at this line.

https://github.com/ptillet/torch-blocksparse/blame/master/torch_blocksparse/matmul.py#L239

The error below occurs because width is used as an int.

TypeError: empty() received an invalid combination of arguments - got (Tensor, dtype=torch.dtype), but expected one of:
 * (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)

This error is triggered when using "dsd" mode.

Testing with PyTorch 1.6.0.

@roastduck
Copy link
Author

I fixed an irrelevant bug in my code and this bug disappeared. But it would be still be better if you can test the code above more thoroughly. Thanks.

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

1 participant