Skip to content

Commit c1cb619

Browse files
remove unused function
1 parent 95438de commit c1cb619

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

mlir-tensorrt/python/bindings/Compiler/CompilerPyBind.cpp

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "mlir/Bindings/Python/PybindAdaptors.h"
2020
#include "pybind11/pybind11.h"
2121
#include "llvm/Support/DynamicLibrary.h"
22+
#include <iostream>
2223
#include <pybind11/attr.h>
2324
#include <pybind11/functional.h>
2425

@@ -68,6 +69,7 @@ class PyStableHLOToExecutableOptions
6869
mtrtPythonCapsuleToStableHLOToExecutableOptions,
6970
mtrtPythonStableHLOToExecutableOptionsToCapsule};
7071

72+
// We need this member so we can keep the Python callback alive long enough.
7173
std::function<std::string(MlirOperation)> callback;
7274
};
7375
} // namespace
@@ -226,25 +228,6 @@ static void bindTensorRTPluginAdaptorObjects(py::module m) {
226228
#endif
227229
#endif
228230

229-
void layerMetadataCallback(MlirOperation op, MlirStringCallback append,
230-
void *appendCtx, void *userDataVoid) {
231-
// auto pyCallback =
232-
// *static_cast<std::function<std::string(MlirOperation)>
233-
// *>(userDataVoid);
234-
235-
// std::string result;
236-
// try {
237-
// result = pyCallback(op);
238-
// } catch (const std::exception &e) {
239-
// // TODO: What to do here? Change callback to return a status
240-
// // instead of void?
241-
// // return mtrtStatusCreate(
242-
// // MTRT_StatusCode::MTRT_StatusCode_Unknown, e.what());
243-
// }
244-
245-
// append(MlirStringRef{result.data(), result.size()}, appendCtx);
246-
}
247-
248231
PYBIND11_MODULE(_api, m) {
249232

250233
populateCommonBindingsInModule(m);
@@ -312,10 +295,7 @@ PYBIND11_MODULE(_api, m) {
312295
try {
313296
result = pyCallback(op);
314297
} catch (const std::exception &e) {
315-
// TODO: What to do here? Change callback to return a status
316-
// instead of void?
317-
// return mtrtStatusCreate(
318-
// MTRT_StatusCode::MTRT_StatusCode_Unknown, e.what());
298+
std::cerr << e.what() << std::endl;
319299
}
320300

321301
append(MlirStringRef{result.data(), result.size()}, appendCtx);

0 commit comments

Comments
 (0)