code: def test_sharding_ebc(
      self,
      use_apply_optimizer_in_backward: bool,
      use_index_dedup: bool,
  ) -> None:
      WORLD_SIZE = 2
  
      embedding_config = [
          EmbeddingConfig(
              name="table_0",
              feature_names=["feature_0"],
              embedding_dim=8,
              num_embeddings=4,
          ),
          EmbeddingConfig(
              name="table_1",
              feature_names=["feature_0", "feature_1"],
              embedding_dim=8,
              num_embeddings=4,
          ),
          EmbeddingConfig(
              name="table_2",
              feature_names=["feature_0", "feature_1"],
              embedding_dim=8,
              num_embeddings=4,
          ),
      ]
  
      # Rank 0
      #             instance 0   instance 1  instance 2
      # "feature_0"   [0, 1]       None        [2]
      # "feature_1"   [0, 1]       None        [2]
  
      # Rank 1
  
      #             instance 0   instance 1  instance 2
      # "feature_0"   [3, 2]       [1,2]       [0,1,2,3]
      # "feature_1"   [2, 3]       None        [2]
  
      kjt_input_per_rank = [  # noqa
          KeyedJaggedTensor.from_lengths_sync(
              keys=["feature_0", "feature_1"],
              values=torch.LongTensor([0, 1, 2, 0, 1, 2]),
              lengths=torch.LongTensor([2, 0, 1, 2, 0, 1]),
          ),
          KeyedJaggedTensor.from_lengths_sync(
              keys=["feature_0", "feature_1"],
              values=torch.LongTensor(
                  [3, 2, 1, 2, 0, 1, 2, 3, 2, 3, 2]
              ),
              lengths=torch.LongTensor([2, 2, 4, 2, 0, 1]),
          ),
      ]
      self._run_multi_process_test(
          callable=_test_sharding,
          world_size=WORLD_SIZE,
          tables=embedding_config,
          kjt_input_per_rank=kjt_input_per_rank,
          backend="nccl",
          use_apply_optimizer_in_backward=use_apply_optimizer_in_backward,
          use_index_dedup=use_index_dedup,
      )
  
imports: import unittest
  from typing import Dict, List, Optional
  import hypothesis.strategies
  import torch
  import torch.nn
  from hypothesis import given, settings, Verbosity
  from torch.distributed.optim import _apply_optimizer_in_backward
  from torchrec import distributed
  from torchrec.distributed.embedding import EmbeddingCollectionSharder, ShardedEmbeddingCollection
  from torchrec.distributed.shard import _shard_modules
  from torchrec.distributed.sharding_plan import column_wise, construct_module_sharding_plan, row_wise, table_wise
  from torchrec.distributed.test_utils.multi_process import MultiProcessContext, MultiProcessTestBase
  from torchrec.distributed.types import ShardedTensor, ShardingEnv, ShardingPlan
  from torchrec.modules.embedding_configs import EmbeddingConfig
  from torchrec.modules.embedding_modules import EmbeddingCollection
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor
  from torchrec.test_utils import skip_if_asan_class
label_desc: Use image node_id 1 for calling the ShardedEmbeddingCollectionParallelTest obj's underlying member method code with example usage: obj.test_sharding_ebc(use_apply_optimizer_in_backward, use_index_dedup) without return types