Dataset can’t cache model’s outputs
{'login': 'jongjyh', 'id': 37979232, 'node_id': 'MDQ6VXNlcjM3OTc5MjMy', 'avatar_url': 'https://avatars.githubusercontent.com/u/37979232?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/jongjyh', 'html_url': 'https://github.com/jongjyh', 'followers_url': 'https://api.github.com/users/jongjyh/followers', 'following_url': 'https://api.github.com/users/jongjyh/following{/other_user}', 'gists_url': 'https://api.github.com/users/jongjyh/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/jongjyh/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/jongjyh/subscriptions', 'organizations_url': 'https://api.github.com/users/jongjyh/orgs', 'repos_url': 'https://api.github.com/users/jongjyh/repos', 'events_url': 'https://api.github.com/users/jongjyh/events{/privacy}', 'received_events_url': 'https://api.github.com/users/jongjyh/received_events', 'type': 'User', 'site_admin': False}
[]
[]
Addressed in https://github.com/huggingface/datasets/pull/5191 (torch.Tensor objects now produce deterministic hashes)
### Describe the bug

Hi,

I try to cache some outputs of teacher model( Knowledge Distillation ) by using map function of Dataset library, while every time I run my code, I still recompute all the sequences. I tested Bert Model like this, I got different hash every single run, so any idea to deal with this?

### Steps to reproduce the bug

1. run below code
2. get different hash
```
from transformers import BertModel
from transformers import AutoTokenizer
import torch
token = ['hello']
model = BertModel.from_pretrained("bert-base-uncased").eval()
tok = AutoTokenizer.from_pretrained("bert-base-uncased")
def abcd():
    with torch.no_grad():
        
        out = model(**tok(token,return_tensors='pt'))[0]
        # out = tok(token)
    return out
from datasets.fingerprint import Hasher
my_func = abcd
print(Hasher.hash(my_func))

print(abcd())
```

### Expected behavior

I wanna cache all the model output 

### Environment info

datasets:2.5.0
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5161/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}