You could use torch.stack
instead of torch.cat
:
L = [ torch.rand(B,C,D,D) for _ in range(K)]
print(L)
L = torch.stack(L)
L.max(0)
You could use torch.stack
instead of torch.cat
:
L = [ torch.rand(B,C,D,D) for _ in range(K)]
print(L)
L = torch.stack(L)
L.max(0)