Description:
Computes the Sinkhorn distance, which can be used for expert routing in MoE models.
Formula:
Input:
cost(R, C): 2D cost matrix tol: tolerance
Initialization:
Repeating:
Until:
Output:
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
[object Object][object Object]
Parameters:
[object Object](aclTensor*, input): cost tensor,[object Object]in the formula, aclTensor on the device. The data type can be BFLOAT16, FLOAT16, or FLOAT. The value must be in the range [0, 1] and can be normalized. The ND format is supported. The input is a two-dimensional matrix, and the number of rows cannot exceed 10,000 and the number of columns cannot exceed 1,024. are supported.[object Object](aclScalar*, input): Sinkhorn tolerance. The data type can be FLOAT. If a null pointer is passed, the value of[object Object]is 0.0001.[object Object](aclTensor*, output): optimal transport tensor,[object Object]in the formula, aclTensor on the device. The data type can be BFLOAT16, FLOAT16, or FLOAT. The can be ND. The shape is 2D. are not supported. The data type and shape are the same as those of the input[object Object].[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns:
[object Object]
Parameters:
[object Object](void*, input): address of the workspace to be allocated on the device.[object Object](uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API[object Object].[object Object](aclOpExecutor*, input): operator executor, containing the operator computation process.[object Object](aclrtStream, input): AscendCL stream for executing the task.
Returns:
- Deterministic compute:
[object Object]defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]