class_docstr: Linear layer (specification key: `linear`).
  
  Args:
      size (int >= 0): Layer output size, 0 implies additionally removing the axis
          (<span style="color:#C00000"><b>required</b></span>).
      bias (bool): Whether to add a trainable bias variable
          (<span style="color:#00C000"><b>default</b></span>: true).
      initialization_scale (float > 0.0): Initialization scale
          (<span style="color:#00C000"><b>default</b></span>: 1.0).
      vars_trainable (bool): Whether layer variables are trainable
          (<span style="color:#00C000"><b>default</b></span>: true).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
code: def __init__(
      self,
      *,
      size,
      bias=True,
      initialization_scale=1.0,
      vars_trainable=True,
      l2_regularization=None,
      name=None,
      input_spec=None,
  ):
      super().__init__(
          l2_regularization=l2_regularization,
          name=name,
          input_spec=input_spec,
      )
  
      if len(self.input_spec.shape) <= 1:
          self.linear = self.submodule(
              name="linear",
              module=Dense,
              size=size,
              bias=bias,
              activation=None,
              dropout=0.0,
              initialization_scale=initialization_scale,
              vars_trainable=vars_trainable,
              input_spec=self.input_spec,
          )
      elif len(self.input_spec.shape) == 2:
          self.linear = self.submodule(
              name="linear",
              module=Conv1d,
              size=size,
              window=1,
              bias=bias,
              activation=None,
              dropout=0.0,
              initialization_scale=initialization_scale,
              vars_trainable=vars_trainable,
              input_spec=self.input_spec,
          )
      elif len(self.input_spec.shape) == 3:
          self.linear = self.submodule(
              name="linear",
              module=Conv2d,
              size=size,
              window=1,
              bias=bias,
              activation=None,
              dropout=0.0,
              initialization_scale=initialization_scale,
              vars_trainable=vars_trainable,
              input_spec=self.input_spec,
          )
      else:
          raise TensorforceError.value(
              name="Linear",
              argument="input rank",
              value=len(self.input_spec.shape),
              hint="<= 3",
          )
  
      self.architecture_kwargs["size"] = str(size)
      self.architecture_kwargs["bias"] = str(bias)
      if initialization_scale != 1.0:
          self.architecture_kwargs["initialization_scale"] = str(
              initialization_scale
          )
      if not vars_trainable:
          self.architecture_kwargs["trainable"] = str(vars_trainable)
      if l2_regularization is not None:
          self.architecture_kwargs["l2_regularization"] = str(
              l2_regularization
          )
  
file_path: tensorforce/tensorforce/core/layers/linear.py
imports: import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import tf_function, TensorSpec
  from tensorforce.core.layers import Conv1d, Conv2d, Dense, Layer
label_desc: Use image node_id 1 to create a new Linear object from inherited base classes: Layer with example: obj = Linear()