a = torch.ones(1,4,1,1)*2
b = torch.ones(1,4,1,1)*3
c = torch.ones(1,4,1,1)*4
#d = torch.ones(1,4,1,1)*5
max_ = torch.max(a,b,c)
print(max_)
TypeError: max() received an invalid combination of arguments - got (Tensor, Tensor, Tensor), but expected one of:
* (Tensor input)
* (Tensor input, name dim, bool keepdim, *, tuple of Tensors out)
* (Tensor input, Tensor other, *, Tensor out)
* (Tensor input, int dim, bool keepdim, *, tuple of Tensors out)
albanD
(Alban D)
2
Hi,
Iām afraid the element-wise max will only work for a pair of Tensors, You will have to do them two by two
1 Like
LawsonAbs
(lawson)
3
you can use topk to get the wanted operation