import torch


def normal(sigma=1.0):
    """
    Normal distribution.

    Args:
        sigma (float): the ``standard deviation`` of the normal distribution.
            computed in the form sigma * N(0, I). [Default: 1.0]

        -- Distribution Args --

        *num_samples (int): number of samples to draw from the distribution
        *shape (int): the shape of the sample
    """
    def _dist_fn(num_samples, shape):
        with torch.no_grad():
            return (sigma * torch.randn((num_samples, *shape)))
    return _dist_fn