Torch.repeat() でできます。
torch.Tensor — PyTorch master documentation
python
1import torch
2
3a = torch.tensor([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]])
4print(a.shape) # torch.Size([1, 10])
5
6a = a.repeat((256, 1))
7print(a.shape) # torch.Size([256, 10])
8print(a)
txt
1tensor([[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
2 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
3 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
4 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
5 ...
6 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
7 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
8 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
9 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]])
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。