def sg_dense(tensor, opt):
    r"""Applies a full connection.
    
    Args:
      tensor: A 2-D tensor (automatically passed by decorator).
      opt:
        in_dim: An `integer`. The size of input dimension.
        dim: An `integer`. The size of output dimension.
        bias: Boolean. If True, biases are added.
        regularizer:  A (Tensor -> Tensor or None) function; the result of applying it on a newly created variable
          will be added to the collection tf.GraphKeys.REGULARIZATION_LOSSES and can be used for regularization
        summary: If True, summaries are added. The default is True.

      
    Returns:
      A `Tensor` with the same type as `tensor`.
    """
    # parameter initialize
    w = tf.sg_initializer.he_uniform('W', (opt.in_dim, opt.dim),
                                     regularizer=opt.regularizer, summary=opt.summary)
    b = tf.sg_initializer.constant('b', opt.dim, summary=opt.summary) if opt.bias else 0

    # apply transform
    out = tf.matmul(tensor, w) + b

    return out