code: def _get_init_attn_c(self, enc_out, enc_mask):
      bsz = enc_out.size(0)
      if self.args.init_attn_c == "zero":
          return enc_out.new_zeros(bsz, self.args.encoder_embed_dim)
      elif self.args.init_attn_c == "avg":
          enc_w = (~enc_mask).type(enc_out.type())
          enc_w = enc_w / enc_w.sum(dim=1, keepdim=True)
          return torch.sum(enc_out * enc_w.unsqueeze(2), dim=1)
      else:
          raise ValueError(f"{self.args.init_attn_c} not supported")
  
imports: import logging
  import torch
  from torch import nn
  from torch.nn import functional
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.modules import LSTMCellWithZoneOut, LocationAttention
label_desc: Use image node_id 3 for calling the Tacotron2Decoder obj's underlying member method code with example usage: obj._get_init_attn_c(enc_out, enc_mask) and returns: enc_out, torch