class_docstr: RDFT reparameterization of a convolution kernel.
  
  This uses the real-input discrete Fourier transform (RDFT) of a kernel as
  its parameterization. The inverse RDFT is applied to the variable to produce
  the kernel.
  
  (see https://en.wikipedia.org/wiki/Discrete_Fourier_transform)
  
  Attributes:
    shape: `tf.TensorShape`. The shape of the convolution kernel.
    real: `tf.Variable`. The real part of the RDFT of the kernel.
    imag: `tf.Variable`. The imaginary part of the RDFT of the kernel.
docstr: Initializer.
  
  Args:
    initial_value: `tf.Tensor` or `None`. The initial value of the kernel. If
      not provided, its `shape` must be given, and the initial value of the
      parameter will be undefined.
    name: String. The name of the kernel.
    shape: `tf.TensorShape` or compatible. Ignored unless `initial_value is
      None`.
    dtype: `tf.dtypes.DType` or compatible. DType of this parameter. If not
      given, inferred from `initial_value`.
docstr_tok: ["Initializer",".","Args",":","initial_value",":","`","tf.Tensor","`","or","`","None","`",".","The","initial","value","of","the","kernel",".","If","not","provided",",","its","`","shape","`","must","be","given",",","and","the","initial","value","of","the","parameter","will","be","undefined",".","name",":","String",".","The","name","of","the","kernel",".","shape",":","`","tf.TensorShape","`","or","compatible",".","Ignored","unless","`","initial_value","is","None","`",".","dtype",":","`","tf.dtypes.DType","`","or","compatible",".","DType","of","this","parameter",".","If","not","given",",","inferred","from","`","initial_value","`","."]
code: def __init__(self, initial_value, name=None, shape=None, dtype=None):
      """Initializer.
  
      Args:
        initial_value: `tf.Tensor` or `None`. The initial value of the kernel. If
          not provided, its `shape` must be given, and the initial value of the
          parameter will be undefined.
        name: String. The name of the kernel.
        shape: `tf.TensorShape` or compatible. Ignored unless `initial_value is
          None`.
        dtype: `tf.dtypes.DType` or compatible. DType of this parameter. If not
          given, inferred from `initial_value`.
      """
      super().__init__(name=name)
      if initial_value is None:
          if shape is None:
              raise ValueError(
                  "If initial_value is None, shape must be specified."
              )
          initial_value = tf.zeros(shape, dtype=dtype)
      else:
          initial_value = tf.convert_to_tensor(
              initial_value, dtype=dtype
          )
      self._shape = initial_value.shape
      self._dtype = initial_value.dtype
  
      if self.shape.rank == 3:
          initial_value = tf.transpose(initial_value, (1, 2, 0))
          initial_value = tf.signal.rfft(initial_value)
      elif self.shape.rank == 4:
          initial_value = tf.transpose(initial_value, (2, 3, 0, 1))
          initial_value = tf.signal.rfft2d(initial_value)
      elif self.shape.rank == 5:
          initial_value = tf.transpose(initial_value, (3, 4, 0, 1, 2))
          initial_value = tf.signal.rfft3d(initial_value)
      else:
          raise ValueError(
              f"Expected kernel tensor of rank 3, 4, or 5; received shape "
              f"{self._shape}."
          )
      norm = tf.constant(
          self.shape[:-2].num_elements() ** 0.5, initial_value.dtype
      )
      initial_value /= norm
      # We split the variable into real and imaginary parts to avoid issues with
      # complex-valued variables being unsupported when saving models, etc.
      real = tf.math.real(initial_value)
      imag = tf.math.imag(initial_value)
      real_name = imag_name = None
      if name is not None:
          real_name = f"{name}_real"
          imag_name = f"{name}_imag"
      self.real = tf.Variable(real, name=real_name)
      self.imag = tf.Variable(imag, name=imag_name)
  
imports: import abc
  from typing import Any, Dict
  import tensorflow
  from tensorflow_compression.python.ops import math_ops
label_desc: Use image node_id 1 to create a new RDFTParameter object from inherited base classes: Parameter with example: obj = RDFTParameter(initial_value, name, shape, dtype)