tl;dr: why torch.repeat() use 1 while torch.expand() use -1 for retaining dimension size of a input tensor??
a = torch.Tensor(range(10)).view(5,2)
print(a.expand(64,-1,-1).shape) # 64, 5, 2
print(a.repeat(64,1,1).shape) # 64, 5, 2

Is it intended to that functions take -1 for expand() but 1 for repeat()? it is quite confusing sometimes. Considering use of -1 in .view(), shouldn’t 1 be replaced with -1 in repeat() either?