Skip to content

Commit 01352f3

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
delete stuff from pybindings.cpp
Summary: Dont think any of this stuff Im deleting is used. It exposes flatbuffer internals which is bad so deleting. I think the remaining stuff is just utils for selective build so we should move this out of exetensions so regular users cant see it. Differential Revision: D48577067 fbshipit-source-id: 4db29048c60344192439eae833ee17c4699eff01
1 parent 3e856c7 commit 01352f3

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

extension/pybindings/pybindings.cpp

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -258,70 +258,10 @@ PYBIND11_MODULE(EXECUTORCH_PYTHON_MODULE_NAME, m) {
258258
&_get_io_metadata_for_program_operators,
259259
py::return_value_policy::copy);
260260

261-
py::class_<executorch_flatbuffer::Chain>(m, "Chain")
262-
.def(
263-
"stacktraces",
264-
[](const executorch_flatbuffer::Chain& self) -> py::object {
265-
if (!self.stacktrace()) {
266-
return py::none();
267-
}
268-
auto stacktraces_size = self.stacktrace()->size();
269-
py::list stacktraces;
270-
for (size_t i = 0; i < stacktraces_size; ++i) {
271-
auto frames = self.stacktrace()->Get(i)->items();
272-
py::list frame_list;
273-
for (size_t fi = 0; fi < frames->size(); ++fi) {
274-
auto frame = frames->Get(fi);
275-
frame_list.append(py::make_tuple(
276-
std::string(
277-
frame->filename()->c_str(), frame->filename()->size()),
278-
frame->lineno(),
279-
std::string(frame->name()->c_str(), frame->name()->size()),
280-
std::string(
281-
frame->context()->c_str(), frame->context()->size())));
282-
}
283-
284-
stacktraces.append(frame_list);
285-
}
286-
return std::move(stacktraces);
287-
},
288-
py::return_value_policy::copy);
289-
290261
py::class_<IOMetaData>(m, "IOMetaData")
291262
.def_readwrite("type", &IOMetaData::type)
292263
.def_readwrite("dtype", &IOMetaData::dtype)
293264
.def_readwrite("dim_order", &IOMetaData::dim_order);
294-
295-
py::class_<executorch_flatbuffer::ExecutionPlan>(m, "ExecutionPlan")
296-
.def(
297-
"chain",
298-
[](const executorch_flatbuffer::ExecutionPlan& self, py::int_ index) {
299-
return self.chains()->Get(index);
300-
},
301-
py::return_value_policy::reference)
302-
.def(
303-
"inputs_size",
304-
[](const executorch_flatbuffer::ExecutionPlan& self) -> int32_t {
305-
if (!self.inputs()) {
306-
return -1;
307-
} else {
308-
return self.inputs()->size();
309-
}
310-
})
311-
.def(
312-
"operators",
313-
[](const executorch_flatbuffer::ExecutionPlan& self) -> py::list {
314-
return py::cast(get_operators_from_execution_plan(self));
315-
},
316-
py::return_value_policy::reference);
317-
318-
py::class_<executorch_flatbuffer::Program>(m, "Program")
319-
.def(
320-
"execution_plan",
321-
[](const executorch_flatbuffer::Program& self, py::int_ index) {
322-
return self.execution_plan()->Get(index);
323-
},
324-
py::return_value_policy::reference);
325265
}
326266

327267
} // namespace executor

0 commit comments

Comments
 (0)