utils.py 355 Bytes
Newer Older
Nicolas Hug's avatar
Nicolas Hug committed
1
2
3
# Don't remove this file and don't change the imports of load_state_dict_from_url
# from other files. We need this so that we can swap load_state_dict_from_url with
# a custom internal version in fbcode.
4
5
6
7
try:
    from torch.hub import load_state_dict_from_url
except ImportError:
    from torch.utils.model_zoo import load_url as load_state_dict_from_url