IReadOnlyTensor<TSelf,T>.ToDenseTensor Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a dense tensor from the elements of the current tensor.
public:
TSelf ToDenseTensor();
public TSelf ToDenseTensor();
abstract member ToDenseTensor : unit -> 'Self
Public Function ToDenseTensor () As TSelf
Returns
The current tensor if it is already dense; otherwise, a new tensor that contains the elements of this tensor.
Remarks
A dense tensor is one where the elements are ordered sequentially in memory and where no gaps exist between the elements.
For a 2x2 Tensor, this would mean it has FlattendLength: 4; Lengths: [2, 2]; Strides: [4, 1]
. The elements would be sequentially accessed via indexes: [0, 0]; [0, 1]; [1, 0]; [1, 1]