Function: create_and_get_op_desc
|
C Prototype |
aclError aclmdlCreateAndGetOpDesc(uint32_t deviceId, uint32_t streamId, uint32_t taskId, char *opName, size_t opNameLen, aclTensorDesc **inputDesc, size_t *numInputs, aclTensorDesc **outputDesc, size_t *numOutputs) |
|---|---|
|
Python Function |
op_name, input_desc, num_inputs, output_desc, num_outputs, ret = acl.mdl.create_and_get_op_desc(device_id, stream_id, task_id, op_name_len) |
|
Function Usage |
Obtains the description of an operator, including the operator name, input tensor description, and output tensor description. If the specified operator cannot be found, an error is returned. This API does not support the dynamic shape scenario. |
|
Input Description |
device_id: int, device ID. Call acl.rt.get_device_id_from_exception_info to obtain the device ID in the exception information. stream_id: int, stream ID. Call acl.rt.get_stream_id_from_exception_info to obtain the stream ID in the exception information. task_id: int, task ID. Call acl.rt.get_task_id_from_exception_info to obtain the task ID in the exception information. op_name_len: int, character string length of the operator name. If the specified length is shorter than the actual length of the operator name, an error is returned. |
|
Return Value |
op_name: string, operator name string. input_desc: int, description of all input tensors of the operator, pointing to the start address of a contiguous memory space. num_inputs: int, number of input tensors. output_desc: int, description of all output tensors of the operator, pointing to the start address of a contiguous memory space. num_outputs: int, number of output tensors. ret: int, error code.
|
|
Restrictions |
Application scenario: For example, if an AI Core error is reported during network inference (dynamic shape scenarios unsupported), you can call this API to obtain the description of the error operator and then perform further troubleshooting.
The recommended API call sequence is as follows:
|
|
Reference |
For details about the API call example, see AI Core Troubleshooting. |