nndeploy C++ API  0.2.0
nndeploy C++ API
util.h
Go to the documentation of this file.
1 
2 #ifndef _NNDEPLOY_OP_UTIL_H_
3 #define _NNDEPLOY_OP_UTIL_H_
4 
5 #include "nndeploy/base/any.h"
6 #include "nndeploy/base/common.h"
8 #include "nndeploy/base/log.h"
9 #include "nndeploy/base/macro.h"
10 #include "nndeploy/base/object.h"
11 #include "nndeploy/base/param.h"
12 #include "nndeploy/base/status.h"
13 #include "nndeploy/base/string.h"
15 #include "nndeploy/device/buffer.h"
16 #include "nndeploy/device/device.h"
18 #include "nndeploy/device/tensor.h"
19 #include "nndeploy/ir/ir.h"
20 
21 namespace nndeploy {
22 namespace op {
23 
24 // adjustNegativeAxes: Negative axes values are translated to the right axis in
25 // the positive range
26 void adjustNegativeAxes(int& axes, int rank);
27 
28 void adjustNegativeAxes(std::vector<int>& axes, int rank);
29 
30 // checkAxesRange: Checks that values are within the range [-rank, rank)
31 bool checkAxesRange(int axes, int rank);
32 bool checkAxesRange(std::vector<int>& axes, int rank);
33 
34 int32_t multiplyDims(const base::IntVector& shape, int from,
35  int upto_exclusive);
36 
37 } // namespace op
38 } // namespace nndeploy
39 
40 #endif /* _NNDEPLOY_OP_UTIL_H_ */
std::vector< int > IntVector
Definition: common.h:379
int32_t multiplyDims(const base::IntVector &shape, int from, int upto_exclusive)
bool checkAxesRange(int axes, int rank)
base::Status shape(device::Tensor *input, std::shared_ptr< ir::ShapeParam > param, device::Tensor *output)
void adjustNegativeAxes(int &axes, int rank)