An example of PyTorch torch.stack

  • 2020-11-26 18:52:32
  • OfStack

It doesn't mean concat


import torch
a = torch.ones([1,2])
b = torch.ones([1,2])
torch.stack([a,b],1)
(0 ,.,.) = 
 1 1
 1 1
[torch.FloatTensor of size 1x2x2]

Related articles: