class_docstr: A training loop that uses the stochastic local closed world assumption training approach.
  
  [ruffinelli2020]_ call the sLCWA ``NegSamp`` in their work.
class_docstr_tok: ["A","training","loop","that","uses","the","stochastic","local","closed","world","assumption","training","approach",".","[","ruffinelli2020","]","_","call","the","sLCWA","``","NegSamp","``","in","their","work","."]
code: def _process_batch_static(
      model: Model,
      loss: Loss,
      mode: Optional[InductiveMode],
      batch: SLCWABatch,
      start: Optional[int],
      stop: Optional[int],
      label_smoothing: float = 0.0,
      slice_size: Optional[int] = None,
  ) -> torch.FloatTensor:
      # Slicing is not possible in sLCWA training loops
      if slice_size is not None:
          raise AttributeError(
              "Slicing is not possible for sLCWA training loops."
          )
  
      # split batch
      positive_batch, negative_batch, positive_filter = batch
  
      # send to device
      positive_batch = positive_batch[start:stop].to(
          device=model.device
      )
      negative_batch = negative_batch[start:stop]
      if positive_filter is not None:
          positive_filter = positive_filter[start:stop]
          negative_batch = negative_batch[positive_filter]
          positive_filter = positive_filter.to(model.device)
      # Make it negative batch broadcastable (required for num_negs_per_pos > 1).
      negative_score_shape = negative_batch.shape[:-1]
      negative_batch = negative_batch.view(-1, 3)
  
      # Ensure they reside on the device (should hold already for most simple negative samplers, e.g.
      # BasicNegativeSampler, BernoulliNegativeSampler
      negative_batch = negative_batch.to(model.device)
  
      # Compute negative and positive scores
      positive_scores = model.score_hrt(positive_batch, mode=mode)
      negative_scores = model.score_hrt(negative_batch, mode=mode).view(
          *negative_score_shape
      )
  
      return (
          loss.process_slcwa_scores(
              positive_scores=positive_scores,
              negative_scores=negative_scores,
              label_smoothing=label_smoothing,
              batch_filter=positive_filter,
              num_entities=model._get_entity_len(mode=mode),
          )
          + model.collect_regularization_term()
      )
  
imports: import logging
  from typing import Optional
  import torch.utils.data
  from class_resolver import HintOrType, OptionalKwargs
  from torch.utils.data import DataLoader
  from .training_loop import TrainingLoop
  from ..losses import Loss
  from ..models.base import Model
  from ..sampling import NegativeSampler
  from ..triples import CoreTriplesFactory
  from ..triples.instances import SLCWABatch, SLCWASampleType
  from ..typing import InductiveMode
label_desc: Use image node_id 4 for calling the SLCWATrainingLoop obj's underlying member method code with example usage: obj._process_batch_static(model, loss, mode, batch, start, stop, label_smoothing, slice_size) and returns: unknown