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

torch.cat raises error when given out tensor #1332

Closed
apaszke opened this issue Apr 22, 2017 · 1 comment
Closed

torch.cat raises error when given out tensor #1332

apaszke opened this issue Apr 22, 2017 · 1 comment

Comments

@apaszke
Copy link
Contributor

apaszke commented Apr 22, 2017

Reported by @chenyuntc


seems to cause error

import torch as t
a=t.Tensor(2,4)
b=t.Tensor(2,4)
c=t.Tensor(2,8)
t.cat(a,b,out=c)
TypeError                                 Traceback (most recent call last)
<ipython-input-1-ce3d61609aec> in <module>()
      3 b=t.Tensor(2,4)
      4 c=t.Tensor(2,8)
----> 5 t.cat(a,b,out=c)

TypeError: cat received an invalid combination of arguments - got (torch.FloatTensor, torch.FloatTensor, out=torch.FloatTensor), but expected one of:
 * (sequence[torch.FloatTensor] seq)
 * (sequence[torch.FloatTensor] seq, int dim)

also see https://discuss.pytorch.org/t/cat-got-an-unexpected-keyword-argument-out/2151

@colesbury
Copy link
Member

The call to cat is wrong.

t.cat([a,b], out=c) not t.cat(a,b,out=c)

eqy pushed a commit to eqy/pytorch that referenced this issue Jan 20, 2022
hubertlu-tw pushed a commit to hubertlu-tw/pytorch that referenced this issue Nov 1, 2022
* Enabled Conv-Bias-ReLU fusion

The following modules are enabled using cuDNN runtime fusion:
1) Conv-Bias-ReLU (+backward)
2) Conv-Bias (+backward)
3) Conv-Bias-Mask-ReLU (+backward)

* Casts cleanup and autocast in unittest

- Remove redundant dtype casts
- Simulate the usage in the unittest by using torch.cuda.amp.autocast

Co-authored-by: Masaki Kozuki <mkozuki@nvidia.com>

* Fixed save_for_backward

Co-authored-by: Masaki Kozuki <mkozuki@nvidia.com>
Co-authored-by: root <root@luna-0277.selene.nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants