Поделиться через


Tensor.CreateFromShape Method

Definition

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<IntPtr>

ReadOnlySpan<nativeint>

The lengths of each dimension.

strides

ReadOnlySpan<IntPtr>

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<IntPtr>

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.

Applies to