code: def __init__(self, ebc, split_idx, specs):
      super().__init__()
      self.split_idx = split_idx
      row_spec, col_spec = specs
  
      # create embedding bags base on the spec
      self.embedding_bags: nn.ModuleDict = nn.ModuleDict()
  
      assert self.split_idx < ebc.num_bags
      for i in range(ebc.num_bags):
          bag_key = f"embedding_bag_{i}"
          if i < self.split_idx:
              shard_module(
                  ebc,
                  plan=ShardingPlan(
                      plan={
                          f"embedding_bags.{bag_key}.weight": row_spec
                      }
                  ),
              )
          else:
              shard_module(
                  ebc,
                  plan=ShardingPlan(
                      plan={
                          f"embedding_bags.{bag_key}.weight": col_spec
                      }
                  ),
              )
  
          self.embedding_bags[bag_key] = ebc.embedding_bags[bag_key]
  
imports: import sys
  import copy
  import torch
  import torch.nn
  from torch.testing._internal.common_distributed import requires_nccl, skip_if_lt_x_gpu
  from torch.distributed._shard import shard_module
  from torch.distributed._shard.sharding_plan import ShardingPlan
  from torch.distributed._shard.sharder import Sharder
  from torch.distributed._shard.sharding_spec import ChunkShardingSpec
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torch.testing._internal.common_utils import TEST_WITH_DEV_DBG_ASAN, run_tests
  from torch.testing._internal.distributed._shard.sharded_tensor import TEST_GPU_NUM, ShardedTensorTestBase, with_comms
label_desc: Use image node_id 1 to create a new CustomShardedEBC object from inherited base classes: nn with example: obj = CustomShardedEBC(ebc, split_idx, specs)