code: def _test_sharded_embedding_bag_with_test_cases(
      self, spec, sharded_dim
  ):
      self._run_sharded_embedding_bag(spec, [5, 5], 17, 14, "sum")
      self._run_sharded_embedding_bag(spec, [5, 4], 17, 12, "mean")
      self._run_sharded_embedding_bag(spec, [6, 7], 21, 11, "max")
      self._run_sharded_embedding_bag(
          spec,
          [5, 5],
          17,
          14,
          "sum",
          max_norm=2.5,
      )
      self._run_sharded_embedding_bag(
          spec,
          [5, 4],
          17,
          12,
          "mean",
          max_norm=2.0,
          norm_type=1.0,
      )
      self._run_sharded_embedding_bag(
          spec,
          [6, 7],
          21,
          11,
          "max",
          max_norm=1.5,
          norm_type=1.0,
      )
      self._run_sharded_embedding_bag(
          spec, [5, 5], 17, 14, "sum", padding_idx=6
      )
      self._run_sharded_embedding_bag(spec, [8, 6], 24, 13, "sum")
      self._run_sharded_embedding_bag(spec, [4, 3], 16, 14, "max")
      self._run_sharded_embedding_bag(
          spec, [8], 23, 13, "sum", offset_size=3
      )
      self._run_sharded_embedding_bag(
          spec, [5], 17, 12, "mean", offset_size=2
      )
      self._run_sharded_embedding_bag(
          spec, [12], 16, 12, "max", offset_size=4
      )
      self._run_sharded_embedding_bag(
          spec,
          [8],
          23,
          13,
          "sum",
          offset_size=3,
          include_last_offset=True,
      )
      self._run_sharded_embedding_bag(
          spec,
          [12],
          16,
          12,
          "max",
          offset_size=4,
          include_last_offset=True,
      )
      self._run_sharded_embedding_bag(
          spec,
          [12],
          17,
          12,
          "sum",
          offset_size=3,
          max_norm=1.25,
      )
      self._run_sharded_embedding_bag(
          spec,
          [5],
          17,
          12,
          "mean",
          offset_size=2,
          max_norm=1.25,
      )
      self._run_sharded_embedding_bag(
          spec,
          [5],
          17,
          12,
          "max",
          offset_size=2,
          max_norm=1.15,
      )
      self._run_sharded_embedding_bag(
          spec, [4, 3], 16, 14, "sum", padding_idx=12
      )
      self._run_sharded_embedding_bag(
          spec, [4, 3], 16, 14, "mean", padding_idx=12
      )
      self._run_sharded_embedding_bag(
          spec, [4, 3], 16, 14, "max", padding_idx=12
      )
      self._run_sharded_embedding_bag(
          spec,
          [12],
          17,
          12,
          "sum",
          offset_size=3,
          max_norm=1.25,
          padding_idx=10,
      )
      self._run_sharded_embedding_bag(
          spec,
          [5],
          17,
          12,
          "mean",
          offset_size=2,
          max_norm=1.25,
          padding_idx=10,
      )
      self._run_sharded_embedding_bag(
          spec,
          [5],
          17,
          12,
          "max",
          offset_size=2,
          max_norm=1.15,
          padding_idx=10,
      )
  
file_path: pytorch/test/distributed/_shard/sharded_tensor/ops/test_embedding_bag.py
imports: import sys
  import torch
  import torch.distributed
  from torch.distributed._shard import shard_parameter
  from torch.testing._internal.common_distributed import requires_nccl, skip_if_lt_x_gpu
  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
  from torch.testing._internal.distributed._shard.sharded_tensor._test_ops_common import clone_module_parameter, generate_chunk_sharding_specs_for_test, generate_local_weight_sharding_params_for_test
label_desc: Use image node_id 4 for calling the TestShardedEmbeddingBag obj's underlying member method code with example usage: obj._test_sharded_embedding_bag_with_test_cases(spec, sharded_dim) without return types