🐛 Describe the bug
Also, note the strange warning when using weights_only=True.
bug.pt.gz
import gzip
import torch
import scipy
bug = torch.load(gzip.open('bug.pt.gz', 'rb'), weights_only=True)
# /home/vadimkantorov/.local/lib/python3.8/site-packages/torch/_utils.py:841: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
# return self.fget.__get__(instance, owner)()
scipy.sparse.coo_matrix((bug['values'], (bug['rowinds'], bug['colinds'])), shape=bug['shape'])
# ok
torch.sparse_coo_tensor((bug['rowinds'], bug['colinds']), bug['values'], size=bug['shape'])
# TypeError: only integer tensors of a single element can be converted to an index
Same error appears in #43949 in a completely different context. This error is extremely mysterious and weird.
Versions
2.1.0.dev20230802+cpu
cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer