Cell In[17], line 1512 for split in user_seq[hist_name]:
13 if hist_name != "history length":
14 user_seq_trunc[hist_name][split] = pad_sequence(
---> 15 [torch.tensor(x[-30:]) for x in user_seq[hist_name][split]],
16 batch_first=True,
17 )
18 else:
19 user_seq_trunc["history mask"][split] = pad_sequence(
20 [torch.ones(min(x, 30)) for x in user_seq[hist_name][split]],
21 batch_first=True,
22 )
Cell In[17], line 15 12 for split in user_seq[hist_name]: 13 if hist_name != "history length": 14 user_seq_trunc[hist_name][split] = pad_sequence( ---> 15 [torch.tensor(x[-30:]) for x in user_seq[hist_name][split]], 16 batch_first=True, 17 ) 18 else: 19 user_seq_trunc["history mask"][split] = pad_sequence( 20 [torch.ones(min(x, 30)) for x in user_seq[hist_name][split]], 21 batch_first=True, 22 )
ValueError: too many dimensions 'str' 请问哪里有问题?