Function: set_tensor_shape
C Prototype |
aclError aclSetTensorShape(aclTensorDesc *desc, int numDims, const int64_t *dims) |
|---|---|
Python Function |
ret = acl.set_tensor_shape(desc, dims) |
Function Usage |
Call acl.set_tensor_shape to set the dimensions of a tensor when the tensor is processed in the Ascend AI Processor after a tensor description is created by the acl.create_tensor_desc call. This API is mainly used in the PyTorch scenarios. The Atlas Training Series Product does not support this API. NOTE:
For example, if the original operator shape is 4D with format NHWC or 5D with format NDHWC, the format is automatically converted to NC1HWC0 or NDC1HWC0 during model conversion or online network build to facilitate data access efficiency on the Ascend AI Processor. Along the process, the operator shape is also inferred to facilitate internal computation. |
Input Description |
desc: int, pointer address of the tensor description data. Call acl.create_tensor_desc to create data of the aclTensorDesc type in advance. dims: list, dimensions to be set. |
Return Value |
ret: int, error code.
|
Restrictions |
None |