code: def test_embedding_from_pretrained_options(self):
      with set_default_dtype(torch.double):
          a = torch.tensor([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
          opts = {
              "max_norm": 2.0,
              "norm_type": 0.5,
              "scale_grad_by_freq": False,
              "sparse": True,
          }
          embedding = nn.Embedding.from_pretrained(a, **opts)
          input = torch.LongTensor([0, 1])
          output = embedding(input)
          # test output and that weight matrix was renormalized
          self.assertEqual(a, output)
          self.assertTrue(
              a.ne(torch.arange(1, 7, dtype=a.dtype).view(2, 3)).all()
          )
          self.assertTrue(
              output.data.norm(p=opts["norm_type"], dim=1)
              .le(opts["max_norm"])
              .all()
          )
  
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 10 for calling the TestEmbeddingNN obj's underlying member method code with example usage: obj.test_embedding_from_pretrained_options() without return types