ztcl::tensor minimum
Gives the smaller of two tensors, element by element.
ztcl::tensor minimum A B
Description
Gives the smaller of the elements of A and B. The shapes broadcast: they align at the right, and a dimension of size 1 repeats. A plain number for one operand is a scalar of the dtype of the other operand, and the operands need one dtype.
Returns
A tensor.
Examples
Each example of this page runs after package require ztcl::tensor.
% ztcl::tensor minimum [ztcl::tensor of {1 5}] 3
tensor f32 2 {1.0 3.0}
Errors
% ztcl::tensor minimum [ztcl::tensor of {1 2 3}] [ztcl::tensor of {1 2}]
tensor: the shapes {3} and {2} do not broadcast
-errorcode ZTCL TENSOR
% ztcl::tensor minimum 1 2
tensor minimum: one operand must be a tensor
-errorcode ZTCL TENSOR
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.4
- Compute cost
- A cost for each element operation by its kind (a copy, an add, a division, a math function, a multiply-add of a matmul), set so that one compute unit takes about the time of one unit of plain Tcl. docs/modules/tensor.md has the table.