(filepath)
| 11 | |
| 12 | |
| 13 | def _torch_load_compat(filepath): |
| 14 | kwargs = {"map_location": "cpu"} |
| 15 | try: |
| 16 | return torch.load(filepath, weights_only=False, **kwargs) |
| 17 | except TypeError: |
| 18 | return torch.load(filepath, **kwargs) |
| 19 | |
| 20 | |
| 21 | def gen_sequence(dim, max_len, sample_size): |