code: def __init__(
      self,
      num_embeddings: int,
      embedding_dim: int,
      device=None,
      gamma: float = 0.0,
  ):
      super(FeatureMomentum, self).__init__()
      self.num_embeddings = num_embeddings
      self.embedding_dim = embedding_dim
  
      pin_memory = device is None or str(device) == "cpu"
      self.emb = torch.empty(
          num_embeddings,
          embedding_dim,
          device=device,
          pin_memory=pin_memory,
      )
      self._device = torch.device("cpu")
      self.reset_parameters()
      self.gamma = gamma
  
file_path: DIG/dig/lsgraph/method/FM.py
imports: import torch
  from torch import nn, Tensor
  from typing import Optional
label_desc: Use image node_id 1 to create a new FeatureMomentum object from inherited base classes: nn with example: obj = FeatureMomentum(num_embeddings, embedding_dim, device, gamma)