Image processing algorithm, batch splitting of tensors. The float16, float32, and uint8 types are supported. Asynchronous calling and memory reuse by inputs and outputs are supported.
It is supported by the Atlas inference product and
The following conditions must be met:
1 | APP_ERROR BatchSplit(const Tensor &src, std::vector<Tensor> &dst, bool isReplace, AscendStream &stream = AscendStream::DefaultStream()); |
Parameter |
Input/Output |
Description |
|---|---|---|
src |
Input |
Tensor class, input tensor. The tensor type can be the float16, float32, or uint8. Three-dimensional and four-dimensional tensors are supported. |
dst |
Output |
std::vector<Tensor> class, output. The float16, float32, and uint8 data types (consistent with that of src) are supported. Empty vectors can be passed. If a vector is not empty, call Tensor.Malloc() to allocate memory for tensors in the vector in advance. |
isReplace |
Input |
Boolean type. When the value is true, the output dst reuses the memory of the input src. Ensure that the life cycles of the two are the same. When the value is false, the output dst and input src do not affect each other (the memory release is determined by the lifetime of each). |
stream |
Input |
AscendStream type. The default value is AscendStream::DefaultStream(). If the parameter value is the default value or the value of isReplace is true, the API calling is synchronous. In other cases, the API calling is asynchronous. |
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |