tensor.binarizer
Maps the values of a tensor element-wise to 0 or 1 based on the comparison against a threshold value.
Args
self
(@Tensor<T>
) - The input tensor to be binarized.threshold
(Option<T>
) - The threshold for the binarization operation.
Returns
A new Tensor<T>
of the same shape as the input tensor with binarized values.
Type Constraints
Constrain input and output types to fixed point numbers.
Examples
Last updated