code: def test_embedding_bag_empty_input(self, device, dtypes):
      m = 4
      n = 3
      x = torch.tensor([], device=device, dtype=dtypes[0])
      for sparse in [True, False]:
          Embed = torch.nn.EmbeddingBag(m, n, sparse=sparse)
          Embed.to(device)
  
          output = Embed(
              input=x,
              offsets=torch.tensor([0], device=device, dtype=dtypes[1]),
          )
          self.assertEqual(output, torch.zeros_like(output))
  
          output = Embed(
              input=x,
              offsets=torch.tensor(
                  [0, 0], device=device, dtype=dtypes[1]
              ),
          )
          self.assertEqual(output, torch.zeros_like(output))
  
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 TestEmbeddingNNDeviceType obj's underlying member method code with example usage: obj.test_embedding_bag_empty_input(device, dtypes) without return types