class_docstr: SegResNetVAE based on `3D MRI brain tumor segmentation using autoencoder regularization
  <https://arxiv.org/pdf/1810.11654.pdf>`_.
  The module contains the variational autoencoder (VAE).
  The model supports 2D or 3D inputs.
  
  Args:
      input_image_size: the size of images to input into the network. It is used to
          determine the in_features of the fc layer in VAE.
      vae_estimate_std: whether to estimate the standard deviations in VAE. Defaults to ``False``.
      vae_default_std: if not to estimate the std, use the default value. Defaults to 0.3.
      vae_nz: number of latent variables in VAE. Defaults to 256.
          Where, 128 to represent mean, and 128 to represent std.
      spatial_dims: spatial dimension of the input data. Defaults to 3.
      init_filters: number of output channels for initial convolution layer. Defaults to 8.
      in_channels: number of input channels for the network. Defaults to 1.
      out_channels: number of output channels for the network. Defaults to 2.
      dropout_prob: probability of an element to be zero-ed. Defaults to ``None``.
      act: activation type and arguments. Defaults to ``RELU``.
      norm: feature normalization type and arguments. Defaults to ``GROUP``.
      use_conv_final: if add a final convolution block to output. Defaults to ``True``.
      blocks_down: number of down sample blocks in each layer. Defaults to ``[1,2,2,4]``.
      blocks_up: number of up sample blocks in each layer. Defaults to ``[1,1,1]``.
      upsample_mode: [``"deconv"``, ``"nontrainable"``, ``"pixelshuffle"``]
          The mode of upsampling manipulations.
          Using the ``nontrainable`` modes cannot guarantee the model's reproducibility. Defaults to``nontrainable``.
  
          - ``deconv``, uses transposed convolution layers.
          - ``nontrainable``, uses non-trainable `linear` interpolation.
          - ``pixelshuffle``, uses :py:class:`monai.networks.blocks.SubpixelUpsample`.
code: def __init__(
      self,
      input_image_size: Sequence[int],
      vae_estimate_std: bool = False,
      vae_default_std: float = 0.3,
      vae_nz: int = 256,
      spatial_dims: int = 3,
      init_filters: int = 8,
      in_channels: int = 1,
      out_channels: int = 2,
      dropout_prob: float | None = None,
      act: str | tuple = ("RELU", {"inplace": True}),
      norm: tuple | str = ("GROUP", {"num_groups": 8}),
      use_conv_final: bool = True,
      blocks_down: tuple = (1, 2, 2, 4),
      blocks_up: tuple = (1, 1, 1),
      upsample_mode: UpsampleMode | str = UpsampleMode.NONTRAINABLE,
  ):
      super().__init__(
          spatial_dims=spatial_dims,
          init_filters=init_filters,
          in_channels=in_channels,
          out_channels=out_channels,
          dropout_prob=dropout_prob,
          act=act,
          norm=norm,
          use_conv_final=use_conv_final,
          blocks_down=blocks_down,
          blocks_up=blocks_up,
          upsample_mode=upsample_mode,
      )
  
      self.input_image_size = input_image_size
      self.smallest_filters = 16
  
      zoom = 2 ** (len(self.blocks_down) - 1)
      self.fc_insize = [s // (2 * zoom) for s in self.input_image_size]
  
      self.vae_estimate_std = vae_estimate_std
      self.vae_default_std = vae_default_std
      self.vae_nz = vae_nz
      self._prepare_vae_modules()
      self.vae_conv_final = self._make_final_conv(in_channels)
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from monai.networks.blocks.segresnet_block import ResBlock, get_conv_layer, get_upsample_layer
  from monai.networks.layers.factories import Dropout
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils import UpsampleMode
label_desc: Use image node_id 1 to create a new SegResNetVAE object from inherited base classes: SegResNet with example: obj = SegResNetVAE(input_image_size, vae_estimate_std, vae_default_std, vae_nz, spatial_dims, init_filters, in_channels, out_channels, dropout_prob, act, norm, use_conv_final, blocks_down, blocks_up, upsample_mode)