Create and initialize a variable using a numpy array and set trainable.
    :param name: (required str) name of the variable
    :param initializer: a numpy array or a tensor

def get_variable(self, name, initializer):
    """
    Create and initialize a variable using a numpy array and set trainable.
    :param name: (required str) name of the variable
    :param initializer: a numpy array or a tensor
    """
    v = tf.get_variable(name, shape=initializer.shape,
                        initializer=(lambda shape, dtype, partition_info:
                                     initializer),
                        trainable=self.training)
    return v