AbsSum
Function Usage
Image processing algorithm, which is used to calculate the sum of absolute values of tensors. float32 and uint8 are supported. Asynchronous calling is supported.
Only Atlas inference product support this API.
The following conditions must be met:
- The input and output tensors must be on the device or DVPP side, and the parameters (stream and data memory) must be on the same device.
- For synchronization, the device where the data memory is located must be the same as the initialized device.
- Handle the issue of out-of-range data type if any.
- The number of channels of the tensor corresponding to each input and output must be the same. The input tensor supports only HWC, and the supported number of channels is 1 or 3. The data type of the output tensor is float32.
Prototype
1 | APP_ERROR AbsSum(const Tensor &src, Tensor &dst, AscendStream &stream = AscendStream::DefaultStream()); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
src |
Input |
Tensor class, input tensor, supporting the float32 and uint8 data types. |
dst |
Output |
Tensor class, output tensor, supporting the float32 data type. An empty tensor can be passed. If dst is not an empty tensor, call Tensor.Malloc() to allocate memory in advance. The shape of the input tensor is HWC, and the shape of the output tensor is C. For example, if the input tensor shape is [16,16,3], the output tensor shape is [3]. |
stream |
Input |
AscendStream type. The default value is AscendStream::DefaultStream(). When the parameter value is the default value, the API calling is a synchronous operation. In other cases, the API calling is an asynchronous operation. |
Response Parameters
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |