MCPcopy Create free account
hub / github.com/alibaba/MNN / _resolveShapeRange

Function _resolveShapeRange

source/geometry/GeometryShape.cpp:18–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17namespace MNN {
18static std::pair<int, int> _resolveShapeRange(const Op* op, int rank) {
19 int start = 0;
20 int end = rank;
21 if (auto param = op->main_as_ShapeParam()) {
22 if (param->hasStart()) {
23 start = param->start();
24 if (start < 0) {
25 start += rank;
26 }
27 }
28 if (param->hasEnd()) {
29 end = param->end();
30 if (end < 0) {
31 end += rank;
32 }
33 }
34 }
35 start = std::max(0, std::min(start, rank));
36 end = std::max(start, std::min(end, rank));
37 return std::make_pair(start, end);
38}
39
40class GeometryShape : public GeometryComputer {
41public:

Callers 1

onComputeMethod · 0.70

Calls 4

maxFunction · 0.50
minFunction · 0.50
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected