-
Notifications
You must be signed in to change notification settings - Fork 6
Description
IndexError Traceback (most recent call last)
in ()
3 rnn_decoder = AttentionDecoder(len(word2Index_dec.keys()),hidden_size,max_source_length,0.2).to(device=device)
4
----> 5 train_Iters(rnn_encoder,rnn_decoder,70000)
1 frames
in train(encoder, decoder, input_tensor, target_tensor, encoder_optimizer, decoder_optimizer, criterion, max_length, iters)
78 p_duplicate_list[duplicate_word_key][duplicate_word_value] = 1
79 p_duplicate = torch.tensor(p_duplicate_list, dtype=torch.float, device=device)
---> 80 p_diag = torch.mm(decoder_attention, p_duplicate)
81 p_diag = p_diag*(torch.tensor([1], device=device).sub(pgen)).expand_as(p_diag)
82 p_add_diag = torch.diag(p_diag.squeeze(0),diagonal=0)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)