Skip to main content

binary_packer

Function binary_packer 

Source
pub fn binary_packer(tensor: &Tensor) -> Result<(Tensor, Tensor)>
Expand description

Binarize a 2D Candle tensor (>= 0 => +1, < 0 => -1) and pack it into (packed_i32, shape_i64) tensors matching upstream binary_packer.

ยงErrors

Returns an error if tensor is not 2D or cannot be converted to host values.