MCPcopy Create free account
hub / github.com/Samsung/ONE / inputsPyArray

Function inputsPyArray

compiler/dalgona/src/Utils.cpp:107–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105py::object none() { return py::none(); }
106
107std::vector<py::dict> inputsPyArray(const luci::CircleNode *node,
108 luci_interpreter::Interpreter *interpreter)
109{
110 assert(node != nullptr); // FIX_CALLER_UNLESS
111 assert(interpreter != nullptr); // FIX_CALLER_UNLESS
112
113 std::vector<py::dict> inputs;
114 for (uint32_t i = 0; i < node->arity(); ++i)
115 {
116 const auto input_tensor = interpreter->getTensor(node->arg(i));
117 auto circle_node = static_cast<luci::CircleNode *>(node->arg(i));
118
119 // skip invalid inputs (e.g., non-existing bias in TCONV)
120 if (circle_node->opcode() == luci::CircleOpcode::CIRCLEOUTPUTEXCLUDE)
121 continue;
122
123 auto py_input =
124 py::dict("name"_a = circle_node->name(), "data"_a = numpyArray(input_tensor),
125 "quantparam"_a = quantparam(input_tensor),
126 "is_const"_a = circle_node->opcode() == luci::CircleOpcode::CIRCLECONST);
127 inputs.push_back(py_input);
128 }
129 return inputs;
130}
131
132std::vector<py::dict> outputsPyArray(const luci::CircleNode *node,
133 luci_interpreter::Interpreter *interpreter)

Callers 2

visitMethod · 0.85
visitMethod · 0.85

Calls 8

numpyArrayFunction · 0.85
quantparamFunction · 0.85
push_backMethod · 0.80
arityMethod · 0.45
getTensorMethod · 0.45
argMethod · 0.45
opcodeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected