MinMax
Function Usage
Image processing algorithm, which is used to obtain the minimum and maximum values of the input tensor. The data types float16, float32, and uint8 are 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.
- The input tensor must be 2-dimensional or 3-dimensional (with one channel), and the output tensor (with one dimension and at least one element) is the extreme value of all elements of the input tensor.
Prototype
1 | APP_ERROR MinMax(const Tensor &src, Tensor &minVal, Tensor &maxVal, AscendStream &stream = AscendStream::DefaultStream()); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
src |
Input |
Tensor class, input tensor, supporting the float16, float32, and uint8 data types. |
minVal |
Output |
Tensor class, minimum value, output tensor. The data type is the same as that of src. An empty tensor can be passed. If minVal is not an empty tensor, call Tensor.Malloc() to allocate memory in advance. |
maxVal |
Output |
Tensor class, maximum value, output tensor. The data type is the same as that of src. An empty tensor can be passed. If maxVal is not an empty tensor, call Tensor.Malloc() to allocate memory in advance. |
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. |