Module Tolk_frontend.Reduce
Reductions.
Each reduction collapses one or more axes. axis selects the axes to reduce (default: all of them) and accepts negative indices. With ~keepdim:true the reduced axes are kept as size 1 instead of being removed.
val sum :
?axis:int list ->
?keepdim:bool ->
?dtype:Tolk_uop.Dtype.Val.t ->
Tensor.t ->
Tensor.tsum t sums the elements of t. The accumulation is done at a widened dtype to limit overflow; pass dtype to fix it. Narrow-float inputs are cast back to their own dtype unless dtype is given.
val prod :
?axis:int list ->
?keepdim:bool ->
?dtype:Tolk_uop.Dtype.Val.t ->
Tensor.t ->
Tensor.tprod t multiplies the elements of t. Pass dtype to set the accumulation dtype.
max t is the largest element of t along the reduced axes.
min t is the smallest element of t along the reduced axes.
any t is true where at least one element along the reduced axes is non-zero.