code: def test_fsdp_sharded_checkpoint_generate(self):
      with contextlib.redirect_stdout(StringIO()):
          with tempfile.TemporaryDirectory(
              "test_fsdp_sharded"
          ) as data_dir:
              log = os.path.join(data_dir, "train.log")
              create_dummy_data(data_dir)
              preprocess_translation_data(data_dir)
              world_size = min(torch.cuda.device_count(), 2)
              train_translation_model(
                  data_dir,
                  "fconv_iwslt_de_en",
                  [
                      "--log-file",
                      log,
                      "--ddp-backend",
                      "fully_sharded",
                      "--use-sharded-state",
                  ],
                  world_size=world_size,
              )
              generate_main(
                  data_dir,
                  ["--checkpoint-shard-count", str(world_size)],
              )
              assert os.path.exists(log)
  
imports: import contextlib
  import json
  import logging
  import os
  import tempfile
  import unittest
  from io import StringIO
  import torch
  from fairseq import options
  from fairseq_cli import train
  from tests.utils import create_dummy_data, generate_main, preprocess_lm_data, preprocess_translation_data, train_language_model, train_translation_model
label_desc: Use image node_id 18 for calling the TestTranslationGPU obj's underlying member method code with example usage: obj.test_fsdp_sharded_checkpoint_generate() without return types