TensorInt8Bit 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
一个 8 位有符号整数张量对象。
public ref class TensorInt8Bit sealed : ITensorpublic ref class TensorInt8Bit 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 TensorInt8Bit 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 TensorInt8Bit 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 TensorInt8Bit : 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 TensorInt8Bit : System.IDisposable, ITensor, IMemoryBufferPublic NotInheritable Class TensorInt8Bit
Implements ITensorPublic NotInheritable Class TensorInt8Bit
Implements IDisposable, IMemoryBuffer, ITensor- 继承
- 属性
- 实现
Windows 要求
| 设备系列 | 
							Windows 10, version 1809 (在 10.0.17763.0 中引入) | 
| API contract | 
							Windows.AI.MachineLearning.MachineLearningContract (在 v1.0 中引入) | 
注解
张量是值的多维数组。 8 位有符号整数张量是 8 位有符号整数值的张量。
张量布局按行为主,紧密包装的连续数据表示每个维度。 张量的总大小是每个维度大小的乘积。
Windows Server
若要在 Windows Server 上使用此 API,必须使用具有桌面体验的 Windows Server 2019。
线程安全
此 API 是线程安全的。
版本历史记录
| Windows 版本 | SDK 版本 | 已添加值 | 
|---|---|---|
| 1903 | 18362 | CreateFromBuffer | 
| 1903 | 18362 | CreateFromShapeArrayAndDataArray | 
属性
| Kind | 功能的种类。 | 
| Shape | 返回每个维度的计数和大小。 | 
| TensorKind | 返回张量的数据类型。 | 
方法
| Close() | 如果没有从此对象创建的未完成 的 IMemoryBufferReference 对象, Close 将释放该对象并销毁其关联的资源。 否则, Close 会将自身与其关联的资源分离,并在最后一个 IMemoryBufferReference 关闭时销毁它们。 | 
| Create() | 在不分配缓冲区的情况下创建 8 位带符号整数张量对象。 | 
| Create(IIterable<Int64>) | 创建 8 位带符号整数张量对象并分配大小 形状的缓冲区。 | 
| CreateFromArray(IIterable<Int64>, Byte[]) | 创建 8 位带符号整数张量对象,分配大小形状的缓冲区,并将所有数据复制到其中。 | 
| CreateFromBuffer(Int64[], IBuffer) | 创建具有给定 形状 的 8 位带符号整数张量对象,并使用 缓冲区 中的基础缓冲区进行后续计算。 | 
| CreateFromIterable(IIterable<Int64>, IIterable<Byte>) | 创建 8 位带符号整数张量对象,分配大小形状的缓冲区,并将所有数据复制到其中。 | 
| CreateFromShapeArrayAndDataArray(Int64[], Byte[]) | 创建 8 位带符号整数张量对象,分配大小形状的缓冲区,并将所有数据复制到其中。 | 
| CreateReference() | 返回支持 8 位带符号整数张量对象的缓冲区的 IMemoryBufferReference 表示形式。 | 
| Dispose() | 执行与释放或重置非托管资源关联的应用程序定义的任务。 | 
| GetAsVectorView() | 返回数据的只读视图。 |