Skip to content
Permalink
Browse files Browse the repository at this point in the history
tfg-translate needs to call InitMlir
PiperOrigin-RevId: 504566500
  • Loading branch information
tlongeri authored and tensorflower-gardener committed Jan 25, 2023
1 parent ec2ee64 commit 2eedc8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/core/ir/importexport/BUILD
Expand Up @@ -219,6 +219,7 @@ tf_cc_binary(
":graphdef_export",
":graphdef_import",
":load_proto",
"//tensorflow/compiler/mlir:init_mlir",
"//tensorflow/core:ops", # Ops need to be registered for import.
"//tensorflow/core/ir:Dialect",
"@llvm-project//mlir:IR",
Expand Down
2 changes: 2 additions & 0 deletions tensorflow/core/ir/importexport/tfg-translate.cc
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
#include "mlir/Support/LogicalResult.h" // from @llvm-project
#include "mlir/Tools/mlir-translate/MlirTranslateMain.h" // from @llvm-project
#include "mlir/Tools/mlir-translate/Translation.h" // from @llvm-project
#include "tensorflow/compiler/mlir/init_mlir.h"
#include "tensorflow/core/ir/dialect.h"
#include "tensorflow/core/ir/importexport/graphdef_export.h"
#include "tensorflow/core/ir/importexport/graphdef_import.h"
Expand Down Expand Up @@ -63,6 +64,7 @@ TranslateFromMLIRRegistration mlir_to_graphdef(

int main(int argc, char **argv) {
mlir::registerAsmPrinterCLOptions();
tensorflow::InitMlir y(&argc, &argv);
return failed(
mlir::mlirTranslateMain(argc, argv, "Graph(Def)<->TFG Translation Tool"));
}

0 comments on commit 2eedc8f

Please sign in to comment.