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 theTensor
to mimic the shape, data type and device.val
- The value to fill theTensor
with.
§Returns
A Tensor
filled with the specified value, with the same shape, data type and device as x
.