nlp_basic_model
nlp_basic_model copied to clipboard
Why do you use .view(-1,n_hidden,1)
Hi,zy: I am reading your code and Ihave a question about this code: "hidden = final_state.view(-1, n_hidden , 1)" Why do you use '.view'? In my opinion, It should use '.permute'
What's more, In " torch.bmm(lstm_output, hidden)". The shape of lstm_output is [batchsize,len_seq,n_hidden],the shape of hidden is [batchsize,2*n_hidden,1]. Can they be multiplied by .bmm?
Actually, the shape of lstm_output is [batchsize,len_seq, 2*n_hidden].