[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Returns the median and position of values in the specified dimension of a tensor after NAN is ignored.

  • Example:

    • Example 1:

      [object Object]
    • Example 2:

      [object Object]
    • Example 3:

      [object Object]
    • Example 4:

      [object Object]
[object Object]

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

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

    • self (aclTensor*, compute input): aclTensor on the device. The shape supports zero to eight dimensions. are supported. The can be ND.
      • [object Object]Atlas training series products[object Object]: The data type can be FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, or INT64.
      • [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]: The data type can be FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, INT64, or BFLOAT16.
    • dim (int64_t, compute input): specified dimension, integer constant on the host. The value range is [–self.dim(), self.dim() – 1].
      • [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]: self.shape[dim] cannot be 1 when the data type of self is BFLOAT16.
    • keepDim (bool, compute input): whether to retain the dimension of the input tensor in the output tensor, bool constant on the host. If the value is true, the size of the corresponding dimension is set to 1. If the value is false, the corresponding dimension is deleted.
    • valuesOut (aclTensor*, compute output): median value, aclTensor on the device. The data type must be the same as that of self. The shape supports zero to eight dimensions. If keepDim is set to true, the shape must have the same size as that of self except dim, and the dim size is 1. If keepDim is set to false, the shape must be the same as that of self except dim. are supported. The can be ND.
      • [object Object]Atlas training series products[object Object]: The data type can be FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, or INT64.
      • [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]: The data type can be FLOAT, FLOAT16, UINT8, INT8, INT16, INT32, INT64, or BFLOAT16.
    • indicesOut (aclTensor*, compute output): median index, aclTensor on the device. The data type can be INT64. The shape supports zero to eight dimensions, and must be the same as that of valuesOut. 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 aclnnNanMedianDimGetWorkspaceSize.
    • 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:

    • aclnnNanMedianDim 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 each data type (closely related to the remaining memory of the machine) is as follows:

    • INT64: 150000000
    • UINT8, INT8, INT16, INT32: 725000000
[object Object]

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

[object Object]