Skip to content

Commit

Permalink
Also move the example input array to the GPU
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
  • Loading branch information
lebrice committed Nov 15, 2024
1 parent 7c64fc5 commit d7cef8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion project/algorithms/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def configure_model(self):
# deterministic weight initialization
torch.manual_seed(self.init_seed)
self.network = instantiate(self.network_config)

self.example_input_array = self.example_input_array.to(self.device) # type: ignore
if any(torch.nn.parameter.is_lazy(p) for p in self.network.parameters()):
# Do a forward pass to initialize any lazy weights. This is necessary for
# distributed training and to infer shapes.
Expand Down

0 comments on commit d7cef8b

Please sign in to comment.