TensorString 類別

定義

字串 tensor 物件。

public ref class TensorString sealed : ITensor
public ref class TensorString sealed : ITensor, IClosable, IMemoryBuffer
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.MachineLearningContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class TensorString final : ITensor
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.MachineLearningContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class TensorString final : ITensor, IClosable, IMemoryBuffer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.MachineLearningContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class TensorString : ITensor
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.MachineLearningContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class TensorString : System.IDisposable, ITensor, IMemoryBuffer
Public NotInheritable Class TensorString
Implements ITensor
Public NotInheritable Class TensorString
Implements IDisposable, IMemoryBuffer, ITensor
繼承
Object Platform::Object IInspectable TensorString
屬性
實作

Windows 需求

裝置系列
Windows 10, version 1809 (已於 10.0.17763.0 引進)
API contract
Windows.AI.MachineLearning.MachineLearningContract (已於 v1.0 引進)

備註

tensor 是值的多維度陣列。 字串張量是字串值的張量。

張量的配置是資料列主要,且緊密封裝的連續資料代表每個維度。 張量的大小總計是每個維度大小的乘積。

Windows Server

若要在 Windows Server 上使用此 API,您必須搭配桌面體驗使用 Windows Server 2019。

執行緒安全

此 API 是安全線程。

版本歷程記錄

Windows 版本 SDK 版本 已新增值
1903 18362 CreateFromShapeArrayAndDataArray

屬性

Kind

傳回功能的種類。

Shape

傳回每個維度的計數和大小。

TensorKind

傳回 tensor 的資料類型。

方法

Close()

如果沒有從這個物件建立的未處理 IMemoryBufferReference 物件, Close 將會處置物件並終結其相關聯的資源。 否則, Close 會將其本身與其相關聯的資源中斷連結,而且會在最後一個 IMemoryBufferReference 關閉時終結它們。

Create()

建立字串 Tensor 物件,而不配置緩衝區。

Create(IIterable<Int64>)

建立字串 tensor 物件,並配置大小 圖形的緩衝區。

CreateFromArray(IIterable<Int64>, String[])

建立字串 Tensor 物件、配置大小圖形的緩衝區,並將所有資料複製到其中。

CreateFromIterable(IIterable<Int64>, IIterable<String>)

建立字串 Tensor 物件、配置大小圖形的緩衝區,並將所有資料複製到其中。

CreateFromShapeArrayAndDataArray(Int64[], String[])

建立字串 Tensor 物件、配置大小圖形的緩衝區,並將所有資料複製到其中。

CreateReference()

TensorString 物件上不允許這個方法,不應使用。

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

GetAsVectorView()

傳回資料的唯讀檢視。

適用於

另請參閱