- Operator function: Computes the p-norm distance of each pair of row vectors in the input
[object Object]. - Formula:
Assume that the shape of the input
[object Object]is [N, M], and indicates the element whose index is[object Object]in row[object Object]of[object Object]. The norm distance between row[object Object]and row[object Object]is calculated as follows: The shape of out is [], where the elements are arranged in the following order: , ..., ,, ... , ...,
Each operator has calls. First, aclnnPdistForwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnPdistForward is called to perform computation.
[object Object][object Object]
Parameters:
[object Object](aclTensor*, computation input):[object Object]in the formula, aclTensor on the device. The data type can be FLOAT or FLOAT16, and must be the same as that of out. The shape can be 2D. are supported. The can be ND.[object Object](aclScalar*, input):[object Object]in the formula, aclScalar on the host. The data range is [0, +∞].[object Object](aclTensor*, computation output):[object Object]in the formula, aclTensor on the device. The data type can be FLOAT or FLOAT16. The shape can be 1D. If the shape of self is [N, M], the shape of out is []. are supported. The can be ND.[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 calling the first-phase API aclnnPdistForwardGetWorkspaceSize.[object Object](aclOpExecutor*, input): operator executor, containing the operator computation process.[object Object](aclrtStream, input): stream for executing the task.
Returns:
- Deterministic computation:
[object Object]defaults to deterministic implementation.
The following examples are for reference only. For details, see .
[object Object]