Revert D33284352: [jit][edge] Do not reuse mobile type parser for all unpicklers.

Test Plan: revert-hammer

Differential Revision:
D33284352 (0a921ba0d0)

Original commit changeset: 997c4f110b36

Original Phabricator Diff: D33284352 (0a921ba0d0)

fbshipit-source-id: af316727442a64f1ae40d53d7a9d26ec550d634e
This commit is contained in:
Zhengxu Chen
2022-01-07 19:56:43 -08:00
committed by Facebook GitHub Bot
parent f626bef598
commit 9762aa0fdc
20 changed files with 54 additions and 81 deletions

View File

@ -12,7 +12,6 @@
#include <torch/csrc/jit/api/compilation_unit.h>
#include <torch/csrc/jit/mobile/interpreter.h>
#include <torch/csrc/jit/mobile/observer.h>
#include <torch/csrc/jit/mobile/type_parser.h>
#include <torch/csrc/jit/mobile/upgrader_mobile.h>
#include <torch/csrc/jit/runtime/instruction.h>
#include <torch/csrc/jit/serialization/import_export_constants.h>
@ -79,6 +78,11 @@
// - Argument::{known_length_,kwarg_only_}
// - FunctionSchema::{overload_name_, is_vararg_, is_varret_}
namespace c10 {
// std::string serializeType(const Type &t);
TypePtr parseType(const std::string& pythonStr);
} // namespace c10
namespace torch {
namespace jit {
using caffe2::serialize::IStreamAdapter;
@ -498,8 +502,7 @@ c10::IValue BytecodeDeserializer::readArchive(
type_resolver,
obj_loader,
device_,
*reader_.get(),
nullptr);
*reader_.get());
return ivalues;
}