class_docstr: Simple model to use for testing. We use an encoder-decoder architecture with tied
  embeddings to make sure we cover enough edge cases.
class_docstr_tok: ["Simple","model","to","use","for","testing",".","We","use","an","encoder-decoder","architecture","with","tied","embeddings","to","make","sure","we","cover","enough","edge","cases","."]
code: def __init__(self, fsdp_wrapper: FairScaleFsdpAccelerator) -> None:
      super().__init__()
      self.embedding = torch.nn.Embedding(12, 4)
      self.emb_proj = fsdp_wrapper.wrap_module(torch.nn.Linear(4, 4))
      self.encoder = fsdp_wrapper.wrap_module(Encoder())
      self.decoder = Decoder(self.embedding, fsdp_wrapper)
      # Add a buffer to make sure these are handled correctly. We don't actually
      # do anything with this though.
      self.register_buffer("buffer", torch.randn(4, 4))
  
imports: import os
  from os import PathLike
  from typing import Union, Dict, Optional
  import torch
  from torch.cuda import amp
  from torch.testing import assert_allclose
  import pytest
  from allennlp.common.testing import AllenNlpTestCase, run_distributed_test, requires_multi_gpu
  from allennlp.nn.util import load_state_dict_distributed
  from allennlp.nn.parallel import FairScaleFsdpAccelerator, FairScaleFsdpWrappedModel, ShardedModuleMixin
label_desc: Use image node_id 1 to create a new EncoderDecoderModel object from inherited base classes: torch.nn with example: obj = EncoderDecoderModel(fsdp_wrapper)