| 107 | }; |
| 108 | |
| 109 | std::vector<char const*> infer_shapes(IExecutionContext& self) |
| 110 | { |
| 111 | int32_t const size{self.getEngine().getNbIOTensors()}; |
| 112 | std::vector<char const*> names(size); |
| 113 | int32_t const nbNames = self.inferShapes(names.size(), names.data()); |
| 114 | |
| 115 | if (nbNames < 0) |
| 116 | { |
| 117 | std::stringstream msg; |
| 118 | msg << "infer_shapes error code: " << nbNames; |
| 119 | utils::throwPyError(PyExc_RuntimeError, msg.str().c_str()); |
| 120 | } |
| 121 | |
| 122 | names.resize(nbNames); |
| 123 | return names; |
| 124 | } |
| 125 | |
| 126 | bool execute_async_v3(IExecutionContext& self, size_t streamHandle) |
| 127 | { |