[object Object]

[object Object][object Object]undefined
[object Object]

Description: Returns the median and position of a specified dimension of a tensor. If the number of elements in the specified dimension is size, the median corresponds to the sorted subscript [object Object].

[object Object]

Each operator has calls. First, aclnnMedianDimGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMedianDim is called to perform computation.

  • [object Object]
  • [object Object]
[object Object]
  • Parameters

    • self (aclTensor*, compute input): input tensor, 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.
    • dim (int64_t, compute input): integer on the host, indicating the specified dimension. The data type can be INT64.
    • keepDim (bool, compute input): Boolean parameter on the host, indicating whether to keep the dimension of the reduced axis. If the value is True, the outputs valuesOut and indicesOut have the same number of dimensions as the input self, and the shape corresponding to dim of the output aclTensor is 1. If the value is False, the dimension corresponding to dim is reduced, and the output has one less dimension than the input. The data type can be BOOL.
    • valuesOut (aclTensor*, compute output): output tensor, median in the specified dimension, aclTensor on the device. The data type is the same as that of self, and the shape corresponds to self based on keepDim. 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.
    • indicesOut (aclTensor*, compute output): output tensor, position of the median in the specified dimension, aclTensor on the device. The data type can be INT64, and the shape must correspond to self based on keepDim. are supported. The can be ND.
    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
    • executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
  • Returns

    aclnnStatus: status code. For details, see .

[object Object]
[object Object]
  • 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 aclnnMedianDimGetWorkspaceSize.
    • executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns aclnnStatus: status code. For details, see .

[object Object]
  • Deterministic compute:

    • aclnnMedianDim 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 the data type of self is BFLOAT16, the case where the dim axis is 1 or scalar inputs are not supported.

[object Object]

The following example is for reference only. For details, see .

[object Object]