class_docstr: Dense layer with spectral normalization applied to weights, as in.
  
  [BJC19]_.
code: def __init__(
      self,
      units: int,
      in_units: int,
      coeff: float = 0.9,
      activation: Optional[str] = None,
      use_bias: bool = True,
      flatten: bool = True,
      weight_initializer: init.Initializer = init.Orthogonal(scale=0.9),
      bias_initializer="zeros",
      dtype="float32",
      num_power_iter: int = 1,
      ctx: Optional[mx.Context] = None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self._coeff = coeff
      self._flatten = flatten
      self._ctx = ctx if ctx is not None else get_mxnet_context()
      self._num_power_iter = num_power_iter
      with self.name_scope():
          self._units = units
          self._in_units = in_units
          self._weight = self.params.get(
              "weight",
              shape=(units, in_units),
              init=weight_initializer,
              dtype=dtype,
          )
          self._u = self.params.get(
              "u", init=mx.init.Normal(), shape=(1, units)
          )
  
          if use_bias:
              self._bias = self.params.get(
                  "bias",
                  shape=(units,),
                  init=bias_initializer,
                  dtype=dtype,
              )
          else:
              self._bias = None
  
          if activation is not None:
              self._act = get_activation(
                  activation, prefix=activation + "_"
              )
          else:
              self._act = None
  
file_path: gluonts/src/gluonts/mx/block/sndense.py
imports: from typing import Optional
  import mxnet
  from mxnet import nd
  from mxnet import autograd
  from mxnet import init
  from gluonts.core.component import validated
  from gluonts.mx.context import get_mxnet_context
  from gluonts.mx import Tensor
  from gluonts.mx.activation import get_activation
label_desc: Use image node_id 1 to create a new SNDense object from inherited base classes: mx.gluon with example: obj = SNDense(units, in_units, coeff, activation, use_bias, flatten, weight_initializer, bias_initializer, dtype, num_power_iter, ctx)