docstr: Args:
      embeddings: tensor of size (batch_size, embedding_size)
      labels: tensor of size (batch_size)
  Does any necessary preprocessing, then does mining, and then checks the
  shape of the mining output before returning it
docstr_tok: ["Args",":","embeddings",":","tensor","of","size","(","batch_size",",","embedding_size",")","labels",":","tensor","of","size","(","batch_size",")","Does","any","necessary","preprocessing",",","then","does","mining",",","and","then","checks","the","shape","of","the","mining","output","before","returning","it"]
code: def forward(self, embeddings, labels, ref_emb=None, ref_labels=None):
      """
      Args:
          embeddings: tensor of size (batch_size, embedding_size)
          labels: tensor of size (batch_size)
      Does any necessary preprocessing, then does mining, and then checks the
      shape of the mining output before returning it
      """
      self.reset_stats()
      with torch.no_grad():
          c_f.check_shapes(embeddings, labels)
          labels = c_f.to_device(labels, embeddings)
          ref_emb, ref_labels = c_f.set_ref_emb(
              embeddings, labels, ref_emb, ref_labels
          )
          mining_output = self.mine(
              embeddings, labels, ref_emb, ref_labels
          )
      self.output_assertion(mining_output)
      return mining_output
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/miners/base_miner.py
imports: import torch
  from ..utils import common_functions
  from ..utils.module_with_records_and_reducer import ModuleWithRecordsAndDistance
label_desc: Use image node_id 4 for calling the BaseMiner obj's underlying member method code with example usage: obj.forward(embeddings, labels, ref_emb, ref_labels) and returns: mining_output