code: def __init__(
      self,
      *,
      batch_size: int,
      input_shape: Tuple[int, ...],
      num_embeddings: int,
      embedding_dim: int,
      padding_idx: Optional[int] = None,
      max_norm: Optional[float] = None,
      norm_type: float = 2.0,
      scale_grad_by_freq: bool = False,
      sparse: bool = False,
      random_seed: Optional[int] = None,
      criterion: Callable = F.cross_entropy,
  ) -> None:
      super().__init__(random_seed=random_seed, criterion=criterion)
  
      self._input_tensor = torch.randint(
          high=num_embeddings,
          size=(batch_size, *input_shape),
          dtype=torch.long,
      )
      self._module = nn.Embedding(
          num_embeddings=num_embeddings,
          embedding_dim=embedding_dim,
          padding_idx=padding_idx,
          max_norm=max_norm,
          norm_type=norm_type,
          scale_grad_by_freq=scale_grad_by_freq,
          sparse=sparse,
      )
      self._labels = torch.randn(
          batch_size, *input_shape, embedding_dim
      )
  
imports: from enum import Enum
  from typing import Callable, Dict, Optional, Tuple, Type, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from opacus.grad_sample import GradSampleModule
  from opacus.grad_sample.utils import wrap_model
  from opacus.layers import DPGRU, DPLSTM, DPRNN, DPMultiheadAttention
  from opacus.layers.dp_rnn import DPRNNBase
label_desc: Use image node_id 1 to create a new EmbeddingBase object from inherited base classes: Layer with example: obj = EmbeddingBase()