class_docstr: Transformer decoder consisting of *cfg.decoder.layers* layers. Each layer
  is a :class:`TransformerDecoderLayer`.
  
  Args:
      cfg (argparse.Namespace): parsed command-line arguments
      dictionary (~fairseq.data.Dictionary): decoding dictionary
      embed_tokens (torch.nn.Embedding): output embedding
      no_encoder_attn (bool, optional): whether to attend to encoder outputs
          (default: False).
class_docstr_tok: ["Transformer","decoder","consisting","of","*","cfg.decoder.layers","*","layers",".","Each","layer","is","a",":","class",":","`","TransformerDecoderLayer","`",".","Args",":","cfg","(","argparse.Namespace",")",":","parsed","command-line","arguments","dictionary","(","~fairseq.data.Dictionary",")",":","decoding","dictionary","embed_tokens","(","torch.nn.Embedding",")",":","output","embedding","no_encoder_attn","(","bool",",","optional",")",":","whether","to","attend","to","encoder","outputs","(","default",":","False",")","."]
code: def buffered_future_mask(self, tensor):
      dim = tensor.size(0)
      # self._future_mask.device != tensor.device is not working in TorchScript. This is a workaround.
      if (
          self._future_mask.size(0) == 0
          or (not self._future_mask.device == tensor.device)
          or self._future_mask.size(0) < dim
      ):
          self._future_mask = torch.triu(
              utils.fill_with_neg_inf(torch.zeros([dim, dim])), 1
          )
      self._future_mask = self._future_mask.to(tensor)
      return self._future_mask[:dim, :dim]
  
imports: import math
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from fairseq import utils
  from fairseq.distributed import fsdp_wrap
  from fairseq.models import FairseqIncrementalDecoder
  from fairseq.models.transformer import TransformerConfig
  from fairseq.modules import AdaptiveSoftmax, BaseLayer, FairseqDropout, LayerDropModuleList, LayerNorm, PositionalEmbedding, SinusoidalPositionalEmbedding, transformer_layer
  from fairseq.modules.checkpoint_activations import checkpoint_wrapper
  from fairseq.modules.quant_noise import quant_noise
label_desc: Use image node_id 9 for calling the TransformerDecoderBase obj's underlying member method code with example usage: obj.buffered_future_mask(tensor) and returns: self