Function: cast
Applicability
|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Function Usage
Casts the data type of a tensor. This API is asynchronous.
Prototype
- C Prototype
1aclError aclopCast(const aclTensorDesc *srcDesc, const aclDataBuffer *srcBuffer, const aclTensorDesc *dstDesc, aclDataBuffer *dstBuffer, uint8_t truncate, aclrtStream stream)
- Python Function
1ret = acl.op.cast(src_desc, src_buffer, dst_desc, dst_buffer, truncate, stream)
Parameter Description
|
Parameter |
Description |
|---|---|
|
src_desc |
Int, pointer address of the input tensor description. |
|
src_buffer |
Int, input tensor, the aclDataBuffer pointer address created by calling acl.create_data_buffer. |
|
dst_desc |
Int, pointer address of the output tensor description. |
|
dst_buffer |
Int, output tensor, the aclDataBuffer pointer address created by calling acl.create_data_buffer. |
|
truncate |
Int, reserved. |
|
stream |
Int, stream where the operator is executed, stream address object. |
Return Value Description
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code: 0 on success; else, failure. |