Torch.cat() throws error?
When running these code: I got an error message: But similar code like this: or this: works well. I’m totally confused. I really need to extract some elements from one tensor and cat them into another tensor. What should I do? Thanks!
Xiaochen_Li
I’m not sure why does it work for regular tensors, I’ll need to look into that, but I think it’s an unintended behaviour.
apaszke
But got this:
Xiaochen_Li
<SCODE>>>> import torch
>>> x = torch.range(1, 2)
>>> y = torch.range(3, 4)
>>> torch.stack([x, y], 0)

 1  2
 3  4
[torch.FloatTensor of size 2x2]
<ECODE>
apaszke