Tensor.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<T>(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean) |
Creates a new tensor with the specified lengths and strides. |
CreateFromShape<T>(ReadOnlySpan<IntPtr>, Boolean) |
Creates a new tensor with the specified lengths. |
CreateFromShape<T>(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean)
- Source:
- Tensor.cs
Creates a new tensor with the specified lengths and strides.
public static System.Numerics.Tensors.Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<IntPtr> lengths, scoped ReadOnlySpan<IntPtr> strides, bool pinned = false);
static member CreateFromShape : ReadOnlySpan<nativeint> * ReadOnlySpan<nativeint> * bool -> System.Numerics.Tensors.Tensor<'T>
Public Function CreateFromShape(Of T) (lengths As ReadOnlySpan(Of IntPtr), strides As ReadOnlySpan(Of IntPtr), Optional pinned As Boolean = false) As Tensor(Of T)
Type Parameters
- T
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
A new tensor with the specified lengths
and strides
.
Applies to
CreateFromShape<T>(ReadOnlySpan<IntPtr>, Boolean)
- Source:
- Tensor.cs
Creates a new tensor with the specified lengths.
public static System.Numerics.Tensors.Tensor<T> CreateFromShape<T>(scoped ReadOnlySpan<IntPtr> lengths, bool pinned = false);
static member CreateFromShape : ReadOnlySpan<nativeint> * bool -> System.Numerics.Tensors.Tensor<'T>
Public Function CreateFromShape(Of T) (lengths As ReadOnlySpan(Of IntPtr), Optional pinned As Boolean = false) As Tensor(Of T)
Type Parameters
- T
Parameters
- lengths
-
ReadOnlySpan<nativeint>
The lengths of each dimension.
- pinned
- Boolean
true
to pin the underlying buffer. The default is false
.
Returns
A new tensor with the specified lengths.