code: def _linear(
      args,
      output_size,
      bias,
      bias_start=0.0,
      weights_init=None,
      trainable=True,
      restore=True,
      reuse=False,
      scope=None,
  ):
      """Linear map: sum_i(args[i] * W[i]), where W[i] is a variable.
  
      Arguments:
          args: a 2D Tensor or a list of 2D, batch x n, Tensors.
          output_size: int, second dimension of W[i].
          bias: boolean, whether to add a bias term or not.
          bias_start: starting value to initialize the bias; 0 by default.
          scope: VariableScope for the created subgraph; defaults to "Linear".
  
      Returns:
          A 2D Tensor with shape [batch x output_size] equal to
          sum_i(args[i] * W[i]), where W[i]s are newly created matrices.
  
      Raises:
          ValueError: if some of the arguments has unspecified or wrong shape.
      """
      if args is None or (is_sequence(args) and not args):
          raise ValueError("`args` must be specified")
      if not is_sequence(args):
          args = [args]
  
      # Calculate the total size of arguments on dimension 1.
      total_arg_size = 0
      shapes = [a.get_shape().as_list() for a in args]
      for shape in shapes:
          if len(shape) != 2:
              raise ValueError(
                  "Linear is expecting 2D arguments: %s" % str(shapes)
              )
          if not shape[1]:
              raise ValueError(
                  "Linear expects shape[1] of arguments: %s"
                  % str(shapes)
              )
          else:
              total_arg_size += shape[1]
  
      # Now the computation.
      with tf.variable_scope(scope or "Linear", reuse=reuse):
          matrix = va.variable(
              "Matrix",
              [total_arg_size, output_size],
              initializer=weights_init,
              trainable=trainable,
              restore=restore,
          )
          if len(args) == 1:
              res = tf.matmul(args[0], matrix)
          else:
              res = tf.matmul(array_ops.concat(args, 1), matrix)
          if not bias:
              return res
          bias_term = va.variable(
              "Bias",
              [output_size],
              initializer=tf.constant_initializer(bias_start),
              trainable=trainable,
              restore=restore,
          )
      return res + bias_term
  
imports: from __future__ import division, print_function, absolute_import
  import logging
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.ops import array_ops
  from tensorflow.python.util.nest import is_sequence
  from ..None import config
  from ..None import utils
  from ..None import activations
  from ..None import initializations
  from ..None import variables
  from .normalization import batch_normalization
label_desc: Use image node_id 6 for calling a global function with example usage: _linear(args, output_size, bias, bias_start, weights_init, trainable, restore, reuse, scope) and returns: unknown, res