def linear(prev_layer, out_dim, name="linear"):
        """Create a linear fully-connected layer.

        Parameters
        ----------

        prev_layer : tf.Tensor
            Last layer's output tensor.

        out_dim : int
            Number of output units.

        Returns
        -------

        tuple (
            tf.Tensor : Linear output tensor
            tf.Tensor : Linear weights variable
            tf.Tensor : Linear biases variable
        )
        """
        with tf.name_scope(name):
            in_dim = prev_layer.get_shape()[1].value
            W = tf.Variable(tf.truncated_normal([in_dim, out_dim], stddev=0.1))
            b = tf.Variable(tf.constant(0.1, shape=[out_dim]))
            out = tf.add(tf.matmul(prev_layer, W), b)
            return (out, W, b)
Create a linear fully-connected layer.

        Parameters
        ----------

        prev_layer : tf.Tensor
            Last layer's output tensor.

        out_dim : int
            Number of output units.

        Returns
        -------

        tuple (
            tf.Tensor : Linear output tensor
            tf.Tensor : Linear weights variable
            tf.Tensor : Linear biases variable
        )
        
yadlt/core/layers.py