This API is used to return the median of all elements. If the total number of elements is size, the median corresponds to the subscript of the sorted array [object Object].
Each operator has calls. First, aclnnMedianGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMedian is called to perform computation.
Parameters
[object Object]Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown:
[object Object]
Deterministic compute:
- aclnnMedian defaults to a deterministic implementation.
If the data type of self is not FLOAT, FLOAT16, or BFLOAT16, the operator execution may time out due to an overlarge tensor size (an AI CPU error is reported, with reason=[aicpu timeout]). The maximum size for the specific type (closely related to the remaining memory of the machine) is as follows:
- INT64 type: 150000000
- UINT8, INT8, INT16, INT32 types: 725000000
When self is of the BFLOAT16 data type, the last axis cannot be 1.
The following example is for reference only. For details, see .