class_docstr: Linear module, optionally including bias.
docstr: Constructs parameters used by this module.
code: def _initialize(self, inputs: tf.Tensor):
      """Constructs parameters used by this module."""
      utils.assert_minimum_rank(inputs, 2)
  
      input_size = inputs.shape[-1]
      if input_size is None:  # Can happen inside an @tf.function.
          raise ValueError(
              "Input size must be specified at module build time."
          )
  
      self.input_size = input_size
  
      if self.w_init is None:
          # See https://arxiv.org/abs/1502.03167v3.
          stddev = 1 / math.sqrt(self.input_size)
          self.w_init = initializers.TruncatedNormal(stddev=stddev)
  
      self.w = tf.Variable(
          self.w_init(
              [self.input_size, self.output_size], inputs.dtype
          ),
          name="w",
      )
  
      if self.with_bias:
          self.b = tf.Variable(
              self.b_init([self.output_size], inputs.dtype), name="b"
          )
  
file_path: sonnet/sonnet/src/linear.py
imports: import math
  from typing import Optional
  from sonnet.src import base
  from sonnet.src import initializers
  from sonnet.src import once
  from sonnet.src import utils
  import tensorflow
label_desc: Use image node_id 2 for calling the Linear obj's underlying member method code with example usage: obj._initialize(inputs) without return types