(input_, output_size, scope=None, stddev=0.5, bias_start=0.0,
           with_w=False)
Compute the linear dot product with the input and its weights plus bias.

    Parameters
    ----------
    input_ : Tensor
        Tensor on which to apply dot product.
    output_size : int
        Number of outputs.

    Returns
    -------
    Tensor
        Linear dot product.
Compute the linear dot product with the input and its weights plus bias.
Compute the linear dot product with the input and its weights plus bias .
def linear(input_, output_size, scope=None, stddev=0.5, bias_start=0.0,
           with_w=False):
    """Compute the linear dot product with the input and its weights plus bias.

    Parameters
    ----------
    input_ : Tensor
        Tensor on which to apply dot product.
    output_size : int
        Number of outputs.

    Returns
    -------
    Tensor
        Linear dot product.
    """
    shape = input_.get_shape().as_list()
    with tf.variable_scope(scope or 'Linear'):
        matrix = tf.get_variable('Matrix', [shape[1], output_size], tf.float32,
                                 tf.random_normal_initializer(stddev=stddev))
        bias = tf.get_variable('bias', [output_size],
                               initializer=tf.constant_initializer(bias_start))
        if with_w:
            return tf.matmul(input_, matrix) + bias, matrix, bias
        else:
            return tf.matmul(input_, matrix) + bias
def linear ( input_ , output_size , scope = None , stddev = 0.5 , bias_start = 0.0 , with_w = False ) : shape = input_ . get_shape ( ) . as_list ( ) with tf . variable_scope ( scope or 'Linear' ) : matrix = tf . get_variable ( 'Matrix' , [ shape [ 1 ] , output_size ] , tf . float32 , tf . random_normal_initializer ( stddev = stddev ) ) bias = tf . get_variable ( 'bias' , [ output_size ] , initializer = tf . constant_initializer ( bias_start ) ) if with_w : return tf . matmul ( input_ , matrix ) + bias , matrix , bias else : return tf . matmul ( input_ , matrix ) + bias