Operator description: Performs transparency multiplication on tensors rgb and alpha.
Formula: out = rgb * ((broadcast)alpha/255)
Example: If rgb is a three-channel color image, and alpha is the transparency (single channel). After this operator is used, a three-channel image with transparency can be generated.
Each operator has calls. First, aclnnMrgbaCustomGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMrgbaCustom is called to perform computation.
[object Object][object Object]
Parameters:
- rgb (aclTensor*, compute input): rgb in the formula, aclTensor on the device. The data type can be UINT8, and the shape supports HWC (C=3), which meets the with alpha. Only contiguous tensors are supported. The can be ND.
- alpha (aclTensor*, compute input): alpha in the formula, aclTensor on the device. The data type can be UINT8, and the shape supports HWC (C = 1), which meets the with rgb. Only contiguous tensors are supported. The can be ND.
- out (aclTensor*, compute output): out in the formula, aclTensor on the device. The data type can be UINT8, and the shape supports HWC (C = 3), which is the same as that of rgb. Only contiguous tensors 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:
[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 aclnnMrgbaCustomGetWorkspaceSize.
- executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
- Deterministic computing:
- aclnnMrgbaCustom defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]