Method filled
static member filled: ITensorDevice -> int64 list -> 'T -> Tensor<'T>
Creates a new tensor filled with the specified value.
Declaration
static member filled: dev:ITensorDevice -> shape:int64 list -> value:'T -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
ITensorDevice | dev | The device to create the tensor on. |
int64 list | shape | The shape of the new tensor. |
'T | value | The value to fill the new tensor with. |
Returns
Type | Description |
---|---|
Tensor<'T> | The new tensor. |
Remarks
A new tensor of the specified shape is created on the specified device.
The tensor is filled with the specified value.
Examples
let a = Tensor.filled HostTensor.Dev [2L; 3L] 1.5
// a = [[1.5; 1.5; 1.5]
// [1.5; 1.5; 1.5]]