Skip to main content

ternary_ste

Function ternary_ste 

Source
pub fn ternary_ste(input: &Tensor, scale: f32) -> Result<Tensor>
Expand description

Apply ternary STE (quantize to {-1, 0, +1}).

§Arguments

  • input - Input tensor
  • scale - Scale factor (typically AbsMean of the input)

§Errors

Returns error if tensor operations fail.