Прочитать на английском

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


ITensor<TSelf,T>.Create 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

Create(ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths.

Create(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths and strides.

Create(ReadOnlySpan<IntPtr>, Boolean)

Source:
ITensor.cs
Source:
ITensor.cs

Creates a new tensor with the specified lengths.

public static abstract TSelf Create(scoped ReadOnlySpan<IntPtr> lengths, bool pinned = false);

Parameters

lengths

ReadOnlySpan<IntPtr>

The lengths of each dimension.

pinned
Boolean

true to pin the underlying buffer. The default is false.

Returns

TSelf

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

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)

Create(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean)

Source:
ITensor.cs
Source:
ITensor.cs

Creates a new tensor with the specified lengths and strides.

public static abstract TSelf Create(scoped ReadOnlySpan<IntPtr> lengths, scoped ReadOnlySpan<IntPtr> strides, bool pinned = false);

Parameters

lengths

ReadOnlySpan<IntPtr>

The lengths of each dimension.

strides

ReadOnlySpan<IntPtr>

The strides of each dimension.

pinned
Boolean

true to pin the underlying buffer. The default is false.

Returns

TSelf

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

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)