aclopCast

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

×

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function Usage

Casts the data type of the input data. This API is asynchronous.

Prototype

1
2
3
4
5
6
aclError aclopCast(const aclTensorDesc *srcDesc,
const aclDataBuffer *srcBuffer,
const aclTensorDesc *dstDesc,
aclDataBuffer *dstBuffer,
uint8_t truncate,
aclrtStream stream)

Parameters

Parameter

Input/Output

Description

srcDesc

Input

Pointer to the input tensor description. For details about the type definition, see aclTensorDesc.

srcBuffer

Input

Pointer to the input tensor. For the type definition, see aclDataBuffer.

dstDesc

Input

Pointer to the output tensor description. For details about the type definition, see aclTensorDesc.

dstBuffer

Output

Pointer to the output tensor. For the type definition, see aclDataBuffer.

truncate

Input

Reserved.

stream

Input

Stream where the operator is executed. For the type definition, see aclrtStream.

Returns

0 on success; else, failure. For details, see aclError.