class_docstr: Transformer decoder consisting of *args.decoder_layers* layers. Each layer
  is a :class:`TransformerAANDecoderLayer`.
class_docstr_tok: ["Transformer","decoder","consisting","of","*","args.decoder_layers","*","layers",".","Each","layer","is","a",":","class",":","`","TransformerAANDecoderLayer","`","."]
code: def buffered_future_mask(self, tensor):
      dim = tensor.size(0)
      if (
          not hasattr(self, "_future_mask")
          or self._future_mask is None
          or self._future_mask.device != tensor.device
      ):
          self._future_mask = torch.triu(
              utils.fill_with_neg_inf(tensor.new(dim, dim)), 1
          )
      if self._future_mask.size(0) < dim:
          self._future_mask = torch.triu(
              utils.fill_with_neg_inf(
                  self._future_mask.resize_(dim, dim)
              ),
              1,
          )
      return self._future_mask[:dim, :dim]
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import options, utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture, transformer
  from fairseq.modules import AdaptiveSoftmax, LearnedPositionalEmbedding, MultiheadAttention, SinusoidalPositionalEmbedding
  from pytorch_translate import transformer, vocab_reduction
  from pytorch_translate.average_attention import AverageAttention, AverageWindowAttention
  from pytorch_translate.utils import torch_find
label_desc: Use image node_id 5 for calling the TransformerAANDecoder obj's underlying member method code with example usage: obj.buffered_future_mask(tensor) and returns: self