Remove the use of the global dialect registry in tf-mlir-translate (NFC)
We've been moving to explicit registration for every users. PiperOrigin-RevId: 328274615 Change-Id: I3c3f83d107ff8131d441640d23b82aaeff86a0b5
This commit is contained in:
parent
2856a636b1
commit
63696674f3
@ -111,8 +111,6 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
if (import_saved_model_object_graph) {
|
if (import_saved_model_object_graph) {
|
||||||
mlir::MLIRContext context;
|
mlir::MLIRContext context;
|
||||||
context.loadAllGloballyRegisteredDialects();
|
|
||||||
|
|
||||||
auto module_or = tensorflow::SavedModelObjectGraphToMlirImport(
|
auto module_or = tensorflow::SavedModelObjectGraphToMlirImport(
|
||||||
input_filename, tags, exported_names, &context);
|
input_filename, tags, exported_names, &context);
|
||||||
if (!module_or.status().ok()) return 1;
|
if (!module_or.status().ok()) return 1;
|
||||||
@ -120,8 +118,6 @@ int main(int argc, char** argv) {
|
|||||||
module_or.ConsumeValueOrDie()->print(output->os());
|
module_or.ConsumeValueOrDie()->print(output->os());
|
||||||
} else if (import_saved_model_signature_defs) {
|
} else if (import_saved_model_signature_defs) {
|
||||||
mlir::MLIRContext context;
|
mlir::MLIRContext context;
|
||||||
context.loadAllGloballyRegisteredDialects();
|
|
||||||
|
|
||||||
auto module_or = tensorflow::SavedModelSignatureDefsToMlirImport(
|
auto module_or = tensorflow::SavedModelSignatureDefsToMlirImport(
|
||||||
input_filename, tags, exported_names, &context, upgrade_legacy);
|
input_filename, tags, exported_names, &context, upgrade_legacy);
|
||||||
if (!module_or.status().ok()) return 1;
|
if (!module_or.status().ok()) return 1;
|
||||||
@ -141,7 +137,6 @@ int main(int argc, char** argv) {
|
|||||||
llvm::SourceMgr sourceMgr;
|
llvm::SourceMgr sourceMgr;
|
||||||
sourceMgr.AddNewSourceBuffer(std::move(ownedBuffer), llvm::SMLoc());
|
sourceMgr.AddNewSourceBuffer(std::move(ownedBuffer), llvm::SMLoc());
|
||||||
mlir::MLIRContext context;
|
mlir::MLIRContext context;
|
||||||
context.loadAllGloballyRegisteredDialects();
|
|
||||||
mlir::SourceMgrDiagnosticHandler diagnostic_handler(sourceMgr, &context);
|
mlir::SourceMgrDiagnosticHandler diagnostic_handler(sourceMgr, &context);
|
||||||
return (*requested_translation)(sourceMgr, os, &context);
|
return (*requested_translation)(sourceMgr, os, &context);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user