TensorFloat16Bit.CreateFromBuffer(Int64[], IBuffer) 方法

定义

创建具有给定 形状 的 16 位浮点张量对象,并使用 数据 中的基础缓冲区进行后续计算。

public:
 static TensorFloat16Bit ^ CreateFromBuffer(Platform::Array <long long> ^ shape, IBuffer ^ buffer);
 static TensorFloat16Bit CreateFromBuffer(winrt::array_view <long> const& shape, IBuffer const& buffer);
public static TensorFloat16Bit CreateFromBuffer(long[] shape, IBuffer buffer);
function createFromBuffer(shape, buffer)
Public Shared Function CreateFromBuffer (shape As Long(), buffer As IBuffer) As TensorFloat16Bit

参数

shape

Int64[]

long long[]

long[]

缓冲区的大小。

buffer
IBuffer

计算期间要使用的缓冲区。

返回

由对提供的 IBuffer数据的缓冲区引用支持的 16 位浮点张量对象。

Windows 要求

设备系列
Windows 10, version 1903 (在 10.0.18362.0 中引入)
API contract
Windows.AI.MachineLearning.MachineLearningContract (在 v2.0 中引入)

注解

创建此对象期间不执行任何复制, 并且数据 中的基础缓冲区由引擎直接使用。

在非 CPU 设备上运行时,将复制到视频内存。

适用于