def tmin(x: T.FloatTensor,
axis: int = None,
keepdims: bool = False) -> T.FloatingPoint:
"""
Return the elementwise minimum of a tensor along the specified axis.
Args:
x: A float or tensor.
axis (optional): The axis for taking the minimum.
keepdims (optional): If this is set to true, the dimension of the tensor
is unchanged. Otherwise, the reduced axis is removed
and the dimension of the array is 1 less.
Returns:
if axis is None:
float: The overall minimum of the elements in the tensor
else:
tensor: The minimum of the tensor along the specified axis.
"""
if axis is not None:
return x.min(dim=axis, keepdim=keepdims)[0]
else:
return x.min()
评论列表
文章目录