Function full_like

Source
pub fn full_like<T: ElemType>(x: &Tensor, val: T) -> Tensor
Expand description

Creates a Tensor filled with a specified value, with the same shape, data type and device as another Tensor.

§Arguments

  • x - The reference to the Tensor to mimic the shape, data type and device.
  • val - The value to fill the Tensor with.

§Returns

A Tensor filled with the specified value, with the same shape, data type and device as x.