code: def __init__(
      self,
      dim,
      ignore_index=0,
      pad_value=0,
      tie_token_embeds=False,
      no_projection=False,
      **kwargs,
  ):
      super().__init__()
      enc_kwargs, dec_kwargs, _ = extract_enc_dec_kwargs(kwargs)
  
      assert (
          "dim" not in dec_kwargs and "dim" not in enc_kwargs
      ), "you must set the dim for both encoder and decoder"
  
      enc_kwargs["dim"] = dec_kwargs["dim"] = dim
      enc_kwargs["no_projection"] = dec_kwargs[
          "no_projection"
      ] = no_projection
  
      dec_kwargs["causal"] = True
      dec_kwargs["cross_attend"] = True
  
      enc = PerformerLM(**enc_kwargs)
      dec = PerformerLM(**dec_kwargs)
  
      if tie_token_embeds:
          enc.token_emb = dec.token_emb
  
      self.enc = enc
      self.dec = AutoregressiveWrapper(
          dec, ignore_index=ignore_index, pad_value=pad_value
      )
  
file_path: performer-pytorch/performer_pytorch/performer_enc_dec.py
imports: import re
  import torch
  from torch import nn
  from performer_pytorch.performer_pytorch import PerformerLM
  from performer_pytorch.autoregressive_wrapper import AutoregressiveWrapper
label_desc: Use image node_id 1 to create a new PerformerEncDec object from inherited base classes: nn with example: obj = PerformerEncDec(dim, ignore_index, pad_value, tie_token_embeds, no_projection)