tilus.Script.min¶
- Script.min(x, *, dim, keepdim=False, out=None)[source]¶
Compute the minimum value along a dimension.
This instruction computes the minimum value of the elements in the register tensor x along the specified dimension dim. If keepdim is set to True, the output tensor will have the same number of dimensions as the input tensor, with the specified dimension reduced to size 1. If keepdim is set to False, the output tensor will have the specified dimension removed, resulting in a tensor with one less dimension.
- Parameters:
x (RegisterTensor) – The register tensor to reduce.
dim (int) – The dimension along which to compute the minimum value. This should be a valid dimension index for the tensor.
keepdim (bool, optional) – Whether to keep the reduced dimension in the output tensor. If True, the output tensor will have the same number of dimensions as the input tensor, with the specified dimension reduced to size 1. If False, the output tensor will have the specified dimension removed, resulting in a tensor with one less dimension. Default is False.
out (RegisterTensor, optional) – The register tensor to store the result. If not provided, a new register tensor will be allocated.
- Returns:
ret – The register tensor containing the minimum value along the specified dimension.
- Return type: