From e0d6898cbd9e7af8ecb1e911e4a8c29e79a78921 Mon Sep 17 00:00:00 2001 From: PyTorch MergeBot Date: Wed, 12 Oct 2022 04:12:43 +0000 Subject: [PATCH] Revert "Backport currently dont work with some models if: (#86510)" This reverts commit 4bfb7341819b3bfcaf65ddc136f25d23983740a7. Reverted https://github.com/pytorch/pytorch/pull/86510 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally --- buckbuild.bzl | 4 +--- torch/csrc/jit/mobile/compatibility/backport_manager.cpp | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/buckbuild.bzl b/buckbuild.bzl index 902cb99baf8..24302e64c92 100644 --- a/buckbuild.bzl +++ b/buckbuild.bzl @@ -1721,9 +1721,6 @@ def define_buck_targets( "{}:flatbuffer_loader".format(ROOT), "{}:flatbuffer_serializer_mobile".format(ROOT), ], - deps = [ - third_party("flatbuffers-api"), - ], ) fb_xplat_cxx_library( @@ -1744,6 +1741,7 @@ def define_buck_targets( ":mobile_bytecode", ":torch_mobile_module", C10, + third_party("flatbuffers-api"), ], exported_deps = [ ":torch_mobile_train", diff --git a/torch/csrc/jit/mobile/compatibility/backport_manager.cpp b/torch/csrc/jit/mobile/compatibility/backport_manager.cpp index 48908491244..2bad08c0765 100644 --- a/torch/csrc/jit/mobile/compatibility/backport_manager.cpp +++ b/torch/csrc/jit/mobile/compatibility/backport_manager.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -504,7 +503,6 @@ std::stringstream backport_v7_to_v6(std::stringstream& input_model_stream) { std::stringstream backport_v9_to_v8(std::stringstream& input_model_stream) { ExtraFilesMap extra_files; - register_flatbuffer_all(); Module torch_script = torch::jit::load(input_model_stream, c10::nullopt, extra_files); std::stringstream intermediate_model_stream;