class_docstr: :math:`\mathcal{S}`-VAE model.
  
  Args:
      model_config (SVAEConfig): The Variational Autoencoder configuration setting the main
      parameters of the model.
  
      encoder (BaseEncoder): An instance of BaseEncoder (inheriting from `torch.nn.Module` which
          plays the role of encoder. This argument allows you to use your own neural networks
          architectures if desired. If None is provided, a simple Multi Layer Preception
          (https://en.wikipedia.org/wiki/Multilayer_perceptron) is used. Default: None.
  
      decoder (BaseDecoder): An instance of BaseDecoder (inheriting from `torch.nn.Module` which
          plays the role of decoder. This argument allows you to use your own neural networks
          architectures if desired. If None is provided, a simple Multi Layer Preception
          (https://en.wikipedia.org/wiki/Multilayer_perceptron) is used. Default: None.
  
  .. note::
      For high dimensional data we advice you to provide you own network architectures. With the
      provided MLP you may end up with a ``MemoryError``.
code: def _acc_rej_steps(
      self, m: int, k: torch.Tensor, device: str = "cpu"
  ):
      batch_size = k.shape[0]
  
      c = torch.sqrt(4 * k**2 + (m - 1) ** 2)
  
      b = (-2 * k + c) / (m - 1)
      a = (m - 1 + 2 * k + c) / 4
      d = (4 * a * b) / (1 + b) - (m - 1) * np.log(m - 1)
  
      d.to(k.device)
      b.to(k.device)
  
      w = torch.zeros_like(k)
  
      stopping_mask = torch.ones_like(torch.tensor(b)).type(torch.bool)
  
      i = 0
  
      while stopping_mask.sum() > 0 and i < 100:
          i += 1
  
          eps = (
              dist.Beta(
                  torch.tensor(0.5 * (m - 1)).type(torch.float),
                  torch.tensor(0.5 * (m - 1)).type(torch.float),
              )
              .sample((batch_size, 1))
              .to(k.device)
          )
  
          w_ = (1 - (1 + b) * eps) / (1 - (1 - b) * eps)
  
          t = 2 * a * b / (1 - (1 - b) * eps)
  
          u = dist.Uniform(0, 1).sample((batch_size, 1)).to(k.device)
  
          acc = (m - 1) * t.log() - t + d > u.log()
          w[acc * stopping_mask] = w_[acc * stopping_mask]
  
          stopping_mask[acc * stopping_mask] = ~acc[acc * stopping_mask]
  
      return w
  
imports: from typing import Optional
  import numpy
  import torch
  import torch.distributions
  import torch.nn.functional
  from ...data.datasets import BaseDataset
  from ..base.base_utils import ModelOutput
  from ..nn import BaseDecoder, BaseEncoder
  from ..nn.default_architectures import Encoder_SVAE_MLP
  from ..vae import VAE
  from .svae_config import SVAEConfig
  from .svae_utils import ive
label_desc: Use image node_id 7 for calling the SVAE obj's underlying member method code with example usage: obj._acc_rej_steps(m, k, device) and returns: w