class_docstr: Simple definition of an autoencoder and base class for the architecture implementing
  :py:class:`monai.networks.nets.VarAutoEncoder`. The network is composed of an encode sequence of blocks, followed
  by an intermediary sequence of blocks, and finally a decode sequence of blocks. The encode and decode blocks are
  default :py:class:`monai.networks.blocks.Convolution` instances with the encode blocks having the given stride
  and the decode blocks having transpose convolutions with the same stride. If `num_res_units` is given residual
  blocks are used instead.
  
  By default the intermediary sequence is empty but if `inter_channels` is given to specify the output channels of
  blocks then this will be become a sequence of Convolution blocks or of residual blocks if `num_inter_units` is
  given. The optional parameter `inter_dilations` can be used to specify the dilation values of the convolutions in
  these blocks, this allows a network to use dilated kernels in this  middle section. Since the intermediary section
  isn't meant to change the size of the output the strides for all these kernels is 1.
  
  Args:
      spatial_dims: number of spatial dimensions.
      in_channels: number of input channels.
      out_channels: number of output channels.
      channels: sequence of channels. Top block first. The length of `channels` should be no less than 2.
      strides: sequence of convolution strides. The length of `stride` should equal to `len(channels) - 1`.
      kernel_size: convolution kernel size, the value(s) should be odd. If sequence,
          its length should equal to dimensions. Defaults to 3.
      up_kernel_size: upsampling convolution kernel size, the value(s) should be odd. If sequence,
          its length should equal to dimensions. Defaults to 3.
      num_res_units: number of residual units. Defaults to 0.
      inter_channels: sequence of channels defining the blocks in the intermediate layer between encode and decode.
      inter_dilations: defines the dilation value for each block of the intermediate layer. Defaults to 1.
      num_inter_units: number of residual units for each block of the intermediate layer. Defaults to 0.
      act: activation type and arguments. Defaults to PReLU.
      norm: feature normalization type and arguments. Defaults to instance norm.
      dropout: dropout ratio. Defaults to no dropout.
      bias: whether to have a bias term in convolution blocks. Defaults to True.
          According to `Performance Tuning Guide <https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html>`_,
          if a conv layer is directly followed by a batch norm layer, bias should be False.
      padding: controls the amount of implicit zero-paddings on both sides for padding number of points
          for each dimension in convolution blocks. Defaults to None.
  
  Examples::
  
      from monai.networks.nets import AutoEncoder
  
      # 3 layers each down/up sampling their inputs by a factor 2 with no intermediate layer
      net = AutoEncoder(
          spatial_dims=2,
          in_channels=1,
          out_channels=1,
          channels=(2, 4, 8),
          strides=(2, 2, 2)
      )
  
      # 1 layer downsampling by 2, followed by a sequence of residual units with 2 convolutions defined by
      # progressively increasing dilations, then final upsample layer
      net = AutoEncoder(
              spatial_dims=2,
              in_channels=1,
              out_channels=1,
              channels=(4,),
              strides=(2,),
              inter_channels=(8, 8, 8),
              inter_dilations=(1, 2, 4),
              num_inter_units=2
          )
code: def forward(self, x: torch.Tensor) -> Any:
      x = self.encode(x)
      x = self.intermediate(x)
      x = self.decode(x)
      return x
  
file_path: MONAI/monai/networks/nets/autoencoder.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import Any
  import torch
  import torch.nn
  from monai.networks.blocks import Convolution, ResidualUnit
  from monai.networks.layers.factories import Act, Norm
label_desc: Use image node_id 7 for calling the AutoEncoder obj's underlying member method code with example usage: obj.forward(x) and returns: x