ztcl::tensor relu
Gives the element, or 0 for an element below 0 for each element.
ztcl::tensor relu TENSOR
Description
Gives a tensor of the shape and the dtype of TENSOR with the element, or 0 for an element below 0 of each element.
Returns
A tensor.
Examples
Each example of this page runs after package require ztcl::tensor.
% ztcl::tensor relu [ztcl::tensor of {-1 0 2} -dtype f64]
tensor f64 3 {0.0 0.0 2.0}
Errors
% ztcl::tensor relu x
not 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.