Currently i m doing something like this:
You could use the elementwise comparison using torch.min
and torch.max
by passing two tensors:
min(input, other, out=None) → Tensor
Each element of the tensorinput
is compared with the corresponding element of the tensor
other
and an element-wise minimum is taken.
The resulting tensor is returned.
a = torch.randn(10, 2)
b = torch.randn(10, 2)
torch.min(a, b)
Thank you for the response,but it doesen t seem to work like that using libtorch.