ITensor<TSelf,T>.CreateFromShape 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.
Overloads
CreateFromShape(ReadOnlySpan<IntPtr>, Boolean) |
Creates a new tensor with the specified lengths. |
CreateFromShape(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean) |
Creates a new tensor with the specified lengths and strides. |
CreateFromShape(ReadOnlySpan<IntPtr>, Boolean)
- Source:
- ITensor_1.cs
Creates a new tensor with the specified lengths.
public static abstract TSelf CreateFromShape(scoped ReadOnlySpan<IntPtr> lengths, bool pinned = false);
static member CreateFromShape : ReadOnlySpan<nativeint> * bool -> 'Self
Public Shared Function CreateFromShape (lengths As ReadOnlySpan(Of IntPtr), Optional pinned As Boolean = false) As TSelf
Parameters
- lengths
-
ReadOnlySpan<nativeint>
The lengths of each dimension.
- pinned
- Boolean
true
to pin the underlying buffer. The default is false
.
Returns
Remarks
If pinned
is true the underlying buffer is created permanently pinned, otherwise the underlying buffer is not pinned.
The underlying buffer is initialized to default values.
Applies to
CreateFromShape(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean)
- Source:
- ITensor_1.cs
Creates a new tensor with the specified lengths and strides.
public static abstract TSelf CreateFromShape(scoped ReadOnlySpan<IntPtr> lengths, scoped ReadOnlySpan<IntPtr> strides, bool pinned = false);
static member CreateFromShape : ReadOnlySpan<nativeint> * ReadOnlySpan<nativeint> * bool -> 'Self
Public Shared Function CreateFromShape (lengths As ReadOnlySpan(Of IntPtr), strides As ReadOnlySpan(Of IntPtr), Optional pinned As Boolean = false) As TSelf
Parameters
- lengths
-
ReadOnlySpan<nativeint>
The lengths of each dimension.
- strides
-
ReadOnlySpan<nativeint>
The strides of each dimension.
- pinned
- Boolean
true
to pin the underlying buffer. The default is false
.
Returns
Remarks
If pinned
is true the underlying buffer is created permanently pinned, otherwise the underlying buffer is not pinned.
The underlying buffer is initialized to default values.