tilus.Script.max¶
- Script.max(x, *, dim, keepdim=False, out=None)[source]¶
Compute the maximum value along a dimension.
- Parameters:
x (RegisterTensor) – The register tensor to reduce.
dim (int) – The dimension along which to compute the maximum 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 maximum value along the specified dimension.
- Return type: