Skip to content

Commit

Permalink
Update on "[PyTorch Mobile] Add an overload for deserialize() that do…
Browse files Browse the repository at this point in the history
…esn't accept the extra_files map."

After the change to split `_load_for_mobile()` into multiple methods, one which takes in the `extra_files` map, and one which doesn't, we can change the implementation of the `deserialize()` method with different overloads as well. Suggested by @razy on D25968216.

#accept2ship

Differential Revision: [D26014084](https://our.internmc.facebook.com/intern/diff/D26014084/)

[ghstack-poisoned]
  • Loading branch information
dhruvbird committed Jan 22, 2021
1 parent e836543 commit 8e6cb59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torch/csrc/jit/mobile/import.cpp
Expand Up @@ -230,8 +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);
mobile::Module deserialize(
c10::optional<at::Device> device,
ExtraFilesMap& extra_files);
Expand Down Expand Up @@ -279,7 +278,8 @@ mobile::Module BytecodeDeserializer::deserialize(
return deserialize(device);
}

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

Expand Down

0 comments on commit 8e6cb59

Please sign in to comment.