tensor.shrink
Shrinks the input tensor element-wise to the output tensor with the same datatype and shape based on the following formula: If x < -lambd: y = x + bias; If x > lambd: y = x - bias; Otherwise: y = 0.
Args
self
(@Tensor<T>
) - The input tensor to be shrinked.bias
(Option<T>
) - The bias value added to or subtracted from input tensor values.lambd
(Option<T>
) - The lambd value defining the shrink condition.
Returns
A new Tensor<T>
of the same datatype and shape as the input tensor with shrinked values.
Type Constraints
Constrain input and output types to fixed point numbers.
Examples
Last updated