class_docstr: A training loop that is based upon the local closed world assumption (LCWA).
  
  Under the LCWA, for a given true training triple $(h, r, t) \in \mathcal{T}_{train}$, all triples
  $(h, r, t') \notin \mathcal{T}_{train}$ are assumed to be false. The training approach thus uses a 1-n scoring,
  where it efficiently computes scores for all triples $(h, r, t')$ for $t' \in \mathcal{E}$, i.e., sharing the
  same (head, relation)-pair.
  
  This implementation slightly generalizes the original LCWA, and allows to make the same assumption for relation, or
  head entity. In particular the second, i.e., predicting the relation, is commonly encountered in visual relation
  prediction.
  
  [ruffinelli2020]_ call the LCWA ``KvsAll`` in their work.
class_docstr_tok: ["A","training","loop","that","is","based","upon","the","local","closed","world","assumption","(","LCWA",")",".","Under","the","LCWA",",","for","a","given","true","training","triple","$","(","h",",","r",",","t",")","\\in","\\mathcal","{","T","}","_","{","train","}","$",",","all","triples","$","(","h",",","r",",","t","'",")","\\notin","\\mathcal","{","T","}","_","{","train","}","$","are","assumed","to","be","false",".","The","training","approach","thus","uses","a","1-n","scoring",",","where","it","efficiently","computes","scores","for","all","triples","$","(","h",",","r",",","t","'",")","$","for","$","t","'","\\in","\\mathcal","{","E","}","$",",","i.e.",",","sharing","the","same","(","head",",","relation",")","-pair",".","This","implementation","slightly","generalizes","the","original","LCWA",",","and","allows","to","make","the","same","assumption","for","relation",",","or","head","entity",".","In","particular","the","second",",","i.e.",",","predicting","the","relation",",","is","commonly","encountered","in","visual","relation","prediction",".","[","ruffinelli2020","]","_","call","the","LCWA","``","KvsAll","``","in","their","work","."]
code: def _check_slicing_availability(self, supports_sub_batching: bool):
      if self.target == 0 and self.model.can_slice_h:
          return
      if self.target == 1 and self.model.can_slice_r:
          return
      if self.target == 2 and self.model.can_slice_t:
          return
      elif supports_sub_batching:
          report = (
              "This model supports sub-batching, but it also requires slicing,"
              " which is not implemented for this model yet."
          )
      else:
          report = (
              "This model doesn't support sub-batching and slicing is not"
              " implemented for this model yet."
          )
      logger.warning(report)
      raise MemoryError(
          "The current model can't be trained on this hardware with these parameters."
      )
  
imports: import logging
  from math import ceil
  from typing import Callable, ClassVar, Optional, Tuple, Union
  import torch
  from torch.nn import functional
  from torch.utils.data import DataLoader, TensorDataset
  from .training_loop import TrainingLoop
  from ..losses import Loss
  from ..models import Model
  from ..triples import CoreTriplesFactory
  from ..triples.instances import LCWABatchType, LCWASampleType
  from ..typing import InductiveMode, MappedTriples
label_desc: Use image node_id 7 for calling the LCWATrainingLoop obj's underlying member method code with example usage: obj._check_slicing_availability(supports_sub_batching) without return types