class_docstr: Average attention.
  See "Accelerating Neural Transformer via an Average Attention Network"
  for more details.
docstr: Input shape: Time x Batch x Channel
  ` mask_trick` is to use matrix multiplication instead of cumulative sum
   to average the inputs.
   Future timesteps can be masked with the
   `mask_future_timesteps` argument. Padding elements can be excluded from
   the key by passing a binary ByteTensor (`key_padding_mask`) with shape:
   batch x src_len, where padding elements are indicated by 1s.
docstr_tok: ["Input","shape",":","Time","x","Batch","x","Channel","`","mask_trick","`","is","to","use","matrix","multiplication","instead","of","cumulative","sum","to","average","the","inputs",".","Future","timesteps","can","be","masked","with","the","`","mask_future_timesteps","`","argument",".","Padding","elements","can","be","excluded","from","the","key","by","passing","a","binary","ByteTensor","(","`","key_padding_mask","`",")","with","shape",":","batch","x","src_len",",","where","padding","elements","are","indicated","by","1s","."]
code: def forward(
      self,
      value,
      mask_trick=False,
      mask_future_timesteps=False,
      incremental_state=None,
  ):
      """Input shape: Time x Batch x Channel
      ` mask_trick` is to use matrix multiplication instead of cumulative sum
       to average the inputs.
       Future timesteps can be masked with the
       `mask_future_timesteps` argument. Padding elements can be excluded from
       the key by passing a binary ByteTensor (`key_padding_mask`) with shape:
       batch x src_len, where padding elements are indicated by 1s.
      """
  
      assert mask_future_timesteps or incremental_state is None
      if incremental_state is None:
          return self._forward(value, mask_trick, mask_future_timesteps)
      else:
          return self._forward_incremental(
              value,
              mask_trick,
              mask_future_timesteps,
              incremental_state,
          )
  
imports: import torch
  import torch.nn.functional
  from fairseq import utils
  from fairseq.incremental_decoding_utils import with_incremental_state
  from torch import nn
label_desc: Use image node_id 2 for calling the AverageAttention obj's underlying member method code with example usage: obj.forward(value, mask_trick, mask_future_timesteps, incremental_state) and returns: self, self