Description: Returns the median of all elements (if the total number of elements is size, the median corresponds to the sorted subscript [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.
[object Object][object Object]
Parameters
- self (aclTensor*, compute input): input
[object Object], aclTensor on the device. The data type is the same as that of valuesOut. are supported. The can be ND.- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, INT64, or BFLOAT16.
- [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, or INT64.
- valuesOut (aclTensor*, output): output
[object Object], zero-dimensional aclTensor on the device, with the same data type as self. are supported. The can be ND.- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, INT64, or BFLOAT16.
- [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, or INT64.
- workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
- executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
- self (aclTensor*, compute input): input
Returns
Parameters
- workspace (void*, input): address of the workspace to be allocated on the device.
- workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnMedianGetWorkspaceSize.
- executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns
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
The following example is for reference only. For details, see .