Skip to main content

safe_zeros

Function safe_zeros 

Source
pub fn safe_zeros(shape: &[i64], kind_device: (Kind, Device)) -> Result<Tensor>
Expand description

Safely allocate a tensor (zeros, ones, randn, etc.)

Wraps tensor allocation operations that might OOM.