Skip to content

Commit

Permalink
Silence Torch Warning
Browse files Browse the repository at this point in the history
And andticipate default change in future releases.
  • Loading branch information
ax3l committed Jan 13, 2025
1 parent 48f6d0f commit be42d8c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ class surrogate_model:
def __init__(self, model_file, device=None):
self.device = device
if device is None:
model_dict = torch.load(model_file, map_location="cpu")
model_dict = torch.load(model_file, map_location="cpu", weights_only=False)
else:
model_dict = torch.load(model_file, map_location=device)
model_dict = torch.load(model_file, map_location=device, weights_only=False)
self.source_means = torch.tensor(
model_dict["source_means"], device=self.device, dtype=torch.float64
)
Expand Down

0 comments on commit be42d8c

Please sign in to comment.