code: def test_embedding_max_norm_unsorted_repeating_indices(self):
      def create_embedding(device):
          # Seed RNG so we get the same Embedding each time
          torch.manual_seed(0)
          return torch.nn.Embedding(
              num_embeddings=20, embedding_dim=64, max_norm=1.0
          ).to(device)
  
      ix = torch.arange(2, device="cpu", dtype=torch.long).repeat(2000)
      out_cpu = create_embedding("cpu")(ix)
  
      ix = ix.to("cuda")
      out = create_embedding("cuda")(ix)
      self.assertEqual(out.cpu(), out_cpu)
  
imports: import unittest
  import random
  import itertools
  from itertools import product
  import torch
  from torch.testing._internal.common_utils import run_tests, set_default_dtype, skipIfTorchDynamo, instantiate_parametrized_tests, parametrize, _assertGradAndGradgradChecks, IS_JETSON
  from torch.testing._internal.common_cuda import TEST_CUDA
  from torch.testing._internal.common_nn import NNTestCase
  from torch.testing._internal.common_device_type import onlyNativeDeviceTypes, dtypes, instantiate_device_type_tests, dtypesIfCUDA, onlyCUDA, TEST_WITH_ROCM, skipCUDAIf, skipMeta
  import torch.nn.functional
  import torch.nn
  from torch.testing._internal.common_utils import dtype2prec_DONTUSE
label_desc: Use image node_id 1 for calling the TestEmbeddingNN obj's underlying member method code with example usage: obj.test_embedding_max_norm_unsorted_repeating_indices() and returns: torch