MCPcopy Create free account
hub / github.com/NVIDIA/DALI / Init

Method Init

dali/operators/generic/slice/subscript.h:93–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92struct SubscriptInfo {
93 void Init(const OpSpec &spec, int i) {
94 at.Init(spec, make_string("at_", i));
95 lo.Init(spec, make_string("lo_", i));
96 hi.Init(spec, make_string("hi_", i));
97 step.Init(spec, make_string("step_", i));
98
99 if (at.IsDefined()) {
100 if (lo.IsDefined() || hi.IsDefined()) {
101 DALI_FAIL(make_string("Internal error: The subscript for dimension ", i,
102 " must not be specified both as an index and as a range."));
103 }
104 if (step.IsDefined()) {
105 DALI_FAIL(make_string("Internal error: The subscript for dimension ", i,
106 " was specified as index - it cannot have a step."));
107 }
108 }
109 }
110
111 bool IsDefined() const {
112 return at.IsDefined() || lo.IsDefined() || hi.IsDefined() || step.IsDefined();

Callers

nothing calls this directly

Calls 3

make_stringFunction · 0.50
InitMethod · 0.45
IsDefinedMethod · 0.45

Tested by

no test coverage detected