Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyTorch Mobile] Add an overload for deserialize() that doesn't accept the extra_files map. #50932

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions torch/csrc/jit/mobile/import.cpp
Expand Up @@ -230,6 +230,7 @@ void parseMethods(
class BytecodeDeserializer final {
public:
explicit BytecodeDeserializer(std::unique_ptr<PyTorchStreamReader> reader);
mobile::Module deserialize(c10::optional<at::Device> device);
mobile::Module deserialize(
c10::optional<at::Device> device,
ExtraFilesMap& extra_files);
Expand Down Expand Up @@ -274,6 +275,12 @@ mobile::Module BytecodeDeserializer::deserialize(
std::string(static_cast<char*>(meta_ptr.get()), meta_size);
}
}
return deserialize(device);
}

mobile::Module BytecodeDeserializer::deserialize(
c10::optional<at::Device> device) {
device_ = device;
auto mcu = std::make_shared<mobile::CompilationUnit>();

// bvals can have 2 possible formats:
Expand Down