I have a problem when I run model.py
if you don't mind can you correct my code here
run with CPU
seq_ent = torch.cat([torch.index_select(seq_out[i,:,:],0,ids[i,:].long()).unsqueeze(0) for i in range(batch_size)], 0) # [batchsize, 4, 768]
IndexError: index out of range in self
run with GPU
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-14-43fe30517134> in <module>()
98 # print(train_data['ids'].shape)
99
--> 100 token_ids = train_data['token_ids'].to(device)
101 attention_masks = train_data['attention_masks'].to(device)
102 token_type_ids = train_data['token_type_ids'].to(device)
RuntimeError: CUDA error: device-side assert triggered