class_docstr: Context gate is a decoder module that takes as input the previous word
  embedding, the current decoder state and the attention state, and
  produces a gate.
  The gate can be used to select the input from the target side context
  (decoder state), from the source context (attention state) or both.
class_docstr_tok: ["Context","gate","is","a","decoder","module","that","takes","as","input","the","previous","word","embedding",",","the","current","decoder","state","and","the","attention","state",",","and","produces","a","gate",".","The","gate","can","be","used","to","select","the","input","from","the","target","side","context","(","decoder","state",")",",","from","the","source","context","(","attention","state",")","or","both","."]
code: def forward(self, prev_emb, dec_state, attn_state):
      input_tensor = torch.cat((prev_emb, dec_state, attn_state), dim=1)
      z = self.sig(self.gate(input_tensor))
      proj_source = self.source_proj(attn_state)
      proj_target = self.target_proj(
          torch.cat((prev_emb, dec_state), dim=1)
      )
      return z, proj_source, proj_target
  
file_path: OpenNMT-py/onmt/modules/gate.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the ContextGate obj's underlying member method code with example usage: obj.forward(prev_emb, dec_state, attn_state) and returns: z,  proj_source,  proj_target