class_docstr: An N-dimensional transpose convolutional module.
  
  Attributes:
     w: Weight variable. Note is `None` until module is connected.
     b: Biases variable. Note is `None` until module is connected.
     input_shape: The input shape of the first set of inputs. Note is `None`
       until module is connected.
class_docstr_tok: ["An","N-dimensional","transpose","convolutional","module",".","Attributes",":","w",":","Weight","variable",".","Note","is","`","None","`","until","module","is","connected",".","b",":","Biases","variable",".","Note","is","`","None","`","until","module","is","connected",".","input_shape",":","The","input","shape","of","the","first","set","of","inputs",".","Note","is","`","None","`","until","module","is","connected","."]
docstr: Constructs a `ConvNDTranspose` module.
  
  Args:
    num_spatial_dims: Number of spatial dimensions of the input.
    output_channels: Number of output channels.
    kernel_shape: Sequence of integers (of length num_spatial_dims), or an
      integer representing kernel shape. `kernel_shape` will be expanded to
      define a kernel size in all dimensions.
    output_shape: Output shape of the spatial dimensions of a transpose
      convolution. Can be either an iterable of integers or a
      `TensorShape` of length `num_spatial_dims`. If a `None` value is given,
      a default shape is automatically calculated.
    stride: Sequence of integers (of length num_spatial_dims), or an integer.
      `stride` will be expanded to define stride in all dimensions.
    rate: Sequence of integers (of length num_spatial_dims), or integer that
      is used to define dilation rate in all dimensions. 1 corresponds to
      standard ND convolution, `rate > 1` corresponds to dilated convolution.
    padding: Padding algorithm, either "SAME" or "VALID".
    with_bias: Boolean, whether to include bias parameters. Default `True`.
    w_init: Optional initializer for the weights. By default the weights are
      initialized truncated random normal values with a standard deviation of
      `1 / sqrt(input_feature_size)`, which is commonly used when the
      inputs are zero centered (see https://arxiv.org/abs/1502.03167v3).
    b_init: Optional initializer for the bias. By default the bias is
      initialized to zero.
    data_format: The data format of the input.
    name: Name of the module.
docstr_tok: ["Constructs","a","`","ConvNDTranspose","`","module",".","Args",":","num_spatial_dims",":","Number","of","spatial","dimensions","of","the","input",".","output_channels",":","Number","of","output","channels",".","kernel_shape",":","Sequence","of","integers","(","of","length","num_spatial_dims",")",",","or","an","integer","representing","kernel","shape",".","`","kernel_shape","`","will","be","expanded","to","define","a","kernel","size","in","all","dimensions",".","output_shape",":","Output","shape","of","the","spatial","dimensions","of","a","transpose","convolution",".","Can","be","either","an","iterable","of","integers","or","a","`","TensorShape","`","of","length","`","num_spatial_dims","`",".","If","a","`","None","`","value","is","given",",","a","default","shape","is","automatically","calculated",".","stride",":","Sequence","of","integers","(","of","length","num_spatial_dims",")",",","or","an","integer",".","`","stride","`","will","be","expanded","to","define","stride","in","all","dimensions",".","rate",":","Sequence","of","integers","(","of","length","num_spatial_dims",")",",","or","integer","that","is","used","to","define","dilation","rate","in","all","dimensions",".","1","corresponds","to","standard","ND","convolution",",","`","rate",">","1","`","corresponds","to","dilated","convolution",".","padding",":","Padding","algorithm",",","either","``","SAME","''","or","``","VALID","''",".","with_bias",":","Boolean",",","whether","to","include","bias","parameters",".","Default","`","True","`",".","w_init",":","Optional","initializer","for","the","weights",".","By","default","the","weights","are","initialized","truncated","random","normal","values","with","a","standard","deviation","of","`","1","\/","sqrt","(","input_feature_size",")","`",",","which","is","commonly","used","when","the","inputs","are","zero","centered","(","see","https",":","\/\/arxiv.org\/abs\/1502.03167v3",")",".","b_init",":","Optional","initializer","for","the","bias",".","By","default","the","bias","is","initialized","to","zero",".","data_format",":","The","data","format","of","the","input",".","name",":","Name","of","the","module","."]
code: def __init__(
      self,
      num_spatial_dims: int,
      output_channels: int,
      kernel_shape: Union[int, Sequence[int]],
      output_shape: Optional[types.ShapeLike] = None,
      stride: Union[int, Sequence[int]] = 1,
      rate: Union[int, Sequence[int]] = 1,
      padding: str = "SAME",
      with_bias: bool = True,
      w_init: Optional[initializers.Initializer] = None,
      b_init: Optional[initializers.Initializer] = None,
      data_format: Optional[str] = None,
      name: Optional[str] = None,
  ):
      """Constructs a `ConvNDTranspose` module.
  
      Args:
        num_spatial_dims: Number of spatial dimensions of the input.
        output_channels: Number of output channels.
        kernel_shape: Sequence of integers (of length num_spatial_dims), or an
          integer representing kernel shape. `kernel_shape` will be expanded to
          define a kernel size in all dimensions.
        output_shape: Output shape of the spatial dimensions of a transpose
          convolution. Can be either an iterable of integers or a
          `TensorShape` of length `num_spatial_dims`. If a `None` value is given,
          a default shape is automatically calculated.
        stride: Sequence of integers (of length num_spatial_dims), or an integer.
          `stride` will be expanded to define stride in all dimensions.
        rate: Sequence of integers (of length num_spatial_dims), or integer that
          is used to define dilation rate in all dimensions. 1 corresponds to
          standard ND convolution, `rate > 1` corresponds to dilated convolution.
        padding: Padding algorithm, either "SAME" or "VALID".
        with_bias: Boolean, whether to include bias parameters. Default `True`.
        w_init: Optional initializer for the weights. By default the weights are
          initialized truncated random normal values with a standard deviation of
          `1 / sqrt(input_feature_size)`, which is commonly used when the
          inputs are zero centered (see https://arxiv.org/abs/1502.03167v3).
        b_init: Optional initializer for the bias. By default the bias is
          initialized to zero.
        data_format: The data format of the input.
        name: Name of the module.
      """
      super().__init__(name=name)
  
      if not 1 <= num_spatial_dims <= 3:
          raise ValueError(
              "We only support transpose convolution operations for "
              "num_spatial_dims=1, 2 or 3, received num_spatial_dims={}.".format(
                  num_spatial_dims
              )
          )
      self._num_spatial_dims = num_spatial_dims
      self._output_channels = output_channels
      self._kernel_shape = kernel_shape
      self._output_shape = output_shape
      self._stride = stride
      self._rate = rate
  
      if padding == "SAME" or padding == "VALID":
          self._padding = padding
      else:
          raise TypeError(
              "ConvNDTranspose only takes string padding, please "
              "provide either `SAME` or `VALID`."
          )
      self._data_format = data_format
      self._channel_index = utils.get_channel_index(data_format)
      self._with_bias = with_bias
  
      self._w_init = w_init
      if with_bias:
          self._b_init = (
              b_init if b_init is not None else initializers.Zeros()
          )
      elif b_init is not None:
          raise ValueError(
              "When not using a bias the b_init must be None."
          )
  
imports: from typing import Optional, Sequence, Union
  import numpy
  from sonnet.src import base
  from sonnet.src import initializers
  from sonnet.src import once
  from sonnet.src import types
  from sonnet.src import utils
  import tensorflow
label_desc: Use image node_id 1 to create a new ConvNDTranspose object from inherited base classes: base with example: obj = ConvNDTranspose(num_spatial_dims, output_channels, kernel_shape, output_shape, stride, rate, padding, with_bias, w_init, b_init, data_format, name)