constant

Function constant 

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

Initialize a tensor with a constant value.