class_docstr: Average attention with window.
  See "Accelerating Neural Transformer via an Average Attention Network"
  for more details.
code: def _forward(self, value, mask_trick, mask_future_timesteps):
      if self.window_size == 1:
          return value, None
      length, batch_size = value.size()[:2]
      if not mask_future_timesteps:
          raise NotImplementedError()
      else:
          v = value.transpose(0, 1)
          attn_weights = value.new_ones(
              length, length, requires_grad=False
          )
          if self.window_size > 0:
              attn_weights.tril_(0).triu_(1 - self.window_size)
          attn_weights.div_(attn_weights.sum(1, keepdim=True))
          attn_weights = attn_weights.unsqueeze_(0).repeat(
              batch_size, 1, 1
          )
          attn = torch.bmm(attn_weights, v)
          attn = attn.transpose(0, 1).contiguous()
  
      return attn, attn_weights
  
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 AverageWindowAttention obj's underlying member method code with example usage: obj._forward(value, mask_trick, mask_future_timesteps) and returns: attn,  attn_weights, value,  None