Skip to content

Commit

Permalink
Adaptation to torch.2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaanaksit committed Dec 3, 2024
1 parent 196a8aa commit a27ebb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions odak/learn/tools/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,24 @@ def save_torch_tensor(fn, tensor):
torch.save(tensor, expanduser(fn))


def torch_load(fn):
def torch_load(fn, weights_only = True):
"""
Definition to load a torch files (*.pt).
Parameters
----------
fn : str
Filename.
weights_only : bool
See torch.load() for details.
Returns
-------
data : any
See torch.load() for more.
"""
data = torch.load(expanduser(fn))
data = torch.load(
expanduser(fn),
weights_only = weights_only
)
return data

0 comments on commit a27ebb8

Please sign in to comment.