| 105 | py::object none() { return py::none(); } |
| 106 | |
| 107 | std::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 | |
| 132 | std::vector<py::dict> outputsPyArray(const luci::CircleNode *node, |
| 133 | luci_interpreter::Interpreter *interpreter) |
no test coverage detected