Three versions of torch.min

There are three types of torch.min operation. Don’t mix them up.

  1. torch.min(input) ----->tensor
    return the min value of all elements in input tensor
  2. torch.min(input, dim,keepdim=False,output=None) -->tensor,tensor
    return the min value of each row of the given dimension and index.
  3. torch.min(input, other,output=None)—>tensor
    compare the each element of input and other and return the smaller one. The sizes of the input and other don’t need to be same, but they need to be broadcastable.
发布了36 篇原创文章 · 获赞 0 · 访问量 9141

猜你喜欢

转载自blog.csdn.net/eliuxiaoming1/article/details/85332839