code: def _convert_lbl_to_long(lbl):
      """
      if the labels are int32, we convert them to int64 since pytorch
      needs a long (int64) type for labels to index. See
      https://discuss.pytorch.org/t/runtimeerror-expected-object-of-scalar-type-long-but-got-scalar-type-float-when-using-crossentropyloss/30542/5  # NOQA
      """
      out_lbl = lbl
      if isinstance(lbl, np.ndarray) and (lbl.dtype == np.int32):
          out_lbl = lbl.astype(np.int64)
      elif isinstance(lbl, list):
          out_lbl = [_convert_lbl_to_long(item) for item in lbl]
      elif isinstance(lbl, np.int32):
          out_lbl = out_lbl.astype(np.int64)
      return out_lbl
  
imports: import logging
  from typing import Any, Callable, Dict, Set
  import numpy
  from classy_vision.generic.distributed_util import get_world_size
  from iopath.common.file_io import g_pathmgr
  from vissl.config import AttrDict
  from vissl.data import dataset_catalog
  from vissl.data.data_helper import balanced_sub_sampling, unbalanced_sub_sampling
  from vissl.data.ssl_transforms import get_transform
  from vissl.data.vissl_dataset_base import VisslDatasetBase
  from vissl.utils.checkpoint import get_checkpoint_folder
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.io import save_file
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_lbl_to_long(lbl) and returns: out_lbl