code: def _attention(self, encoder_hiddens, init_state):
      init_state = init_state.unsqueeze(0).expand_as(encoder_hiddens)
      attn_input = torch.cat([init_state, encoder_hiddens], 2)
      attn_scores = F.relu(self.attn_layer(attn_input))
      attn_scores = F.softmax(attn_scores, 0)
      return attn_scores
  
file_path: translate/pytorch_translate/word_prediction/word_predictor.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 4 for calling the WordPredictor obj's underlying member method code with example usage: obj._attention(encoder_hiddens, init_state) and returns: attn_scores