Constructor ( .ctor )
new: TensorLayout * ITensorStorage<'T> -> Tensor<'T>
Implicit constructor.
Declaration
new: layout:TensorLayout * storage:ITensorStorage<'T> -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
TensorLayout | layout | The memory layout to use. |
ITensorStorage<'T> | storage | The storage to use. |
Returns
Type | Description |
---|---|
Tensor<'T> | A tensor using the specified memory layout and storage. |
new: int64 list * ITensorDevice * TensorOrder option -> Tensor<'T>
Creates a new, uninitialized tensor with a new storage.
Declaration
new: shape:int64 list * dev:ITensorDevice * order:TensorOrder option -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
int64 list | shape | The shape of the tensor to create. |
ITensorDevice | dev | The device to store the data of the tensor on. |
TensorOrder option | order | The memory layout to use for the new tensor. (default: row-major) |
Returns
Type | Description |
---|---|
Tensor<'T> | The new, uninitialized tensor. |
Remarks
The contents of the new tensor are undefined. The default memory layout is row-major.
The recommended way to create a new tensor is to use static member zeros: ITensorDevice -> int64 list -> Tensor<'T>.