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

定义

创建具有给定 形状 的 8 位无符号整数张量对象,并使用 缓冲区中的基础缓冲区 进行后续评估。

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

参数

shape

Int64[]

long long[]

long[]

缓冲区的大小。

buffer
IBuffer

在评估期间使用的缓冲区。

返回

一个 8 位无符号整数张量对象,由缓冲区引用提供的 IBuffer缓冲区

Windows 要求

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

注解

创建此对象期间不会执行任何副本,并且引擎直接使用 缓冲区中的基础缓冲区

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

适用于