目录
repeat函数
expand函数:
expand
expand_as函数:

目录
repeat函数
expand函数:
expand
expand_as函数:
import torch a = torch.tensor([[1, 2, 3],[1, 2, 3]]) print(a) b = torch.tensor([[2, 2, 2], [3, 3, 3], [3, 3, 3], [3, 3, 3]]) print(a.shape,b.size()) c = a.repeat(2,1) print(c) print(c.size())