class_docstr: A training loop.
class_docstr_tok: ["A","training","loop","."]
docstr: Find the maximum slice size for training with the current setting.
  
  This method finds the biggest slice size to train the model with the given training data and the desired batch
  and sub_batch size on the hardware at hand. If even the slice size 1 is too high, it will raise an error.
  Otherwise it will return the determined slice size.
  
  :param triples_factory:
      A triples factory
  :param batch_size:
      The batch size to use.
  :param sub_batch_size:
      The sub-batch size to use.
  :param supports_sub_batching:
      Indicator if the model supports sub-batching. This is used to create appropriate error messages, if needed.
  
  :return:
      The slice_size that allows training the model with the given parameters on this hardware.
  
  :raises MemoryError:
      If it is not possible to train the model on the hardware at hand with the given parameters.
docstr_tok: ["Find","the","maximum","slice","size","for","training","with","the","current","setting",".","This","method","finds","the","biggest","slice","size","to","train","the","model","with","the","given","training","data","and","the","desired","batch","and","sub_batch","size","on","the","hardware","at","hand",".","If","even","the","slice","size","1","is","too","high",",","it","will","raise","an","error",".","Otherwise","it","will","return","the","determined","slice","size",".",":","param","triples_factory",":","A","triples","factory",":","param","batch_size",":","The","batch","size","to","use",".",":","param","sub_batch_size",":","The","sub-batch","size","to","use",".",":","param","supports_sub_batching",":","Indicator","if","the","model","supports","sub-batching",".","This","is","used","to","create","appropriate","error","messages",",","if","needed",".",":","return",":","The","slice_size","that","allows","training","the","model","with","the","given","parameters","on","this","hardware",".",":","raises","MemoryError",":","If","it","is","not","possible","to","train","the","model","on","the","hardware","at","hand","with","the","given","parameters","."]
code: def _slice_size_search(
      self,
      *,
      triples_factory: CoreTriplesFactory,
      batch_size: int,
      sub_batch_size: int,
      supports_sub_batching: bool,
  ) -> int:
      """Find the maximum slice size for training with the current setting.
  
      This method finds the biggest slice size to train the model with the given training data and the desired batch
      and sub_batch size on the hardware at hand. If even the slice size 1 is too high, it will raise an error.
      Otherwise it will return the determined slice size.
  
      :param triples_factory:
          A triples factory
      :param batch_size:
          The batch size to use.
      :param sub_batch_size:
          The sub-batch size to use.
      :param supports_sub_batching:
          Indicator if the model supports sub-batching. This is used to create appropriate error messages, if needed.
  
      :return:
          The slice_size that allows training the model with the given parameters on this hardware.
  
      :raises MemoryError:
          If it is not possible to train the model on the hardware at hand with the given parameters.
      """
      raise NotImplementedError
  
imports: import gc
  import logging
  import os
  import pathlib
  import pickle
  import random
  import time
  from abc import ABC, abstractmethod
  from contextlib import ExitStack
  from datetime import datetime
  from hashlib import md5
  from tempfile import NamedTemporaryFile, TemporaryDirectory
  from typing import IO, Any, ClassVar, Generic, List, Mapping, Optional, Tuple, TypeVar, Union
  import numpy
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from class_resolver.contrib.torch import lr_scheduler_resolver, optimizer_resolver
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader
  from tqdm.autonotebook import tqdm, trange
  from .callbacks import GradientAbsClippingTrainingCallback, GradientNormClippingTrainingCallback, LearningRateSchedulerTrainingCallback, MultiTrainingCallback, OptimizerTrainingCallback, StopperTrainingCallback, TrackerTrainingCallback, TrainingCallback, TrainingCallbackHint, TrainingCallbackKwargsHint
  from ..constants import PYKEEN_CHECKPOINTS, PYKEEN_DEFAULT_CHECKPOINT
  from ..lr_schedulers import LRScheduler
  from ..models import RGCN, Model
  from ..stoppers import Stopper
  from ..trackers import ResultTracker, tracker_resolver
  from ..triples import CoreTriplesFactory, TriplesFactory
  from ..typing import InductiveMode
  from ..utils import format_relative_comparison, get_batchnorm_modules, get_preferred_device, is_cuda_oom_error, is_cudnn_error, normalize_string
label_desc: Use image node_id 15 for calling the TrainingLoop obj's underlying member method code with example usage: obj._slice_size_search() without return types