class_docstr: Pre-batched training instances for the sLCWA training loop.
  
  .. note ::
      this class is intended to be used with automatic batching disabled, i.e., both parameters `batch_size` and
      `batch_sampler` of torch.utils.data.DataLoader` are set to `None`.
class_docstr_tok: ["Pre-batched","training","instances","for","the","sLCWA","training","loop",".","..","note",":",":","this","class","is","intended","to","be","used","with","automatic","batching","disabled",",","i.e.",",","both","parameters","`","batch_size","`","and","`","batch_sampler","`","of","torch.utils.data.DataLoader","`","are","set","to","`","None","`","."]
docstr: Split workload for multi-processing.
docstr_tok: ["Split","workload","for","multi-processing","."]
code: def split_workload(self, n: int) -> range:
      """Split workload for multi-processing."""
      # cf. https://pytorch.org/docs/stable/data.html#torch.utils.data.IterableDataset
      worker_info = torch.utils.data.get_worker_info()
      if (
          worker_info is None
      ):  # single-process data loading, return the full iterator
          workload = range(n)
      else:
          num_workers = worker_info.num_workers
          worker_id = worker_info.id  # 1-based
          start = math.ceil(n / num_workers * worker_id)
          stop = math.ceil(n / num_workers * (worker_id + 1))
          workload = range(start, stop)
      return workload
  
imports: import math
  from abc import ABC, abstractmethod
  from typing import Callable, Generic, Iterable, Iterator, List, NamedTuple, Optional, Tuple, TypeVar
  import numpy
  import scipy.sparse
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from torch.utils import data
  from .utils import compute_compressed_adjacency_list
  from ..sampling import NegativeSampler, negative_sampler_resolver
  from ..typing import MappedTriples
label_desc: Use image node_id 3 for calling the BaseBatchedSLCWAInstances obj's underlying member method code with example usage: obj.split_workload(n) and returns: workload