ones

Function ones 

Source
pub fn ones<B>(
    shape: impl Into<Shape>,
    dtype: DType,
    device: &<B as Backend>::Device,
) -> Result<Tensor<B>, Error>
where B: Backend,
Expand description

Initialize a tensor with all ones (as a variable).