Skip to content

torch.cat raises error when given out tensor #1332

@apaszke

Description

@apaszke

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions