Draw random samples from a normal (Gaussian) distribution.

    Samples are distributed according to a normal distribution parametrized
    by *loc* (mean) and *scale* (standard deviation).


    Parameters
    ----------
    loc : float or NDArray, optional
        Mean (centre) of the distribution.
    scale : float or NDArray, optional
        Standard deviation (spread or width) of the distribution.
    shape : int or tuple of ints, optional
        The number of samples to draw. If shape is, e.g., `(m, n)` and `loc` and
        `scale` are scalars, output shape will be `(m, n)`. If `loc` and `scale`
        are NDArrays with shape, e.g., `(x, y)`, then output will have shape
        `(x, y, m, n)`, where `m*n` samples are drawn for each `[loc, scale)` pair.
    dtype : {'float16', 'float32', 'float64'}, optional
        Data type of output samples. Default is 'float32'
    ctx : Context, optional
        Device context of output. Default is current context. Overridden by
        `loc.context` when `loc` is an NDArray.
    out : NDArray, optional
        Store output to an existing NDArray.

    Returns
    -------
    NDArray
        An NDArray of type `dtype`. If input `shape` has shape, e.g., `(m, n)` and
        `loc` and `scale` are scalars, output shape will be `(m, n)`. If `loc` and
        `scale` are NDArrays with shape, e.g., `(x, y)`, then output will have shape
        `(x, y, m, n)`, where `m*n` samples are drawn for each `[loc, scale)` pair.

    Examples
    --------
    >>> mx.nd.random.normal(0, 1)
    [ 2.21220636]
    <NDArray 1 @cpu(0)>
    >>> mx.nd.random.normal(0, 1, ctx=mx.gpu(0))
    [ 0.29253659]
    <NDArray 1 @gpu(0)>
    >>> mx.nd.random.normal(-1, 1, shape=(2,))
    [-0.2259962  -0.51619542]
    <NDArray 2 @cpu(0)>
    >>> loc = mx.nd.array([1,2,3])
    >>> scale = mx.nd.array([2,3,4])
    >>> mx.nd.random.normal(loc, scale, shape=2)
    [[ 0.55912292  3.19566321]
     [ 1.91728961  2.47706747]
     [ 2.79666662  5.44254589]]
    <NDArray 3x2 @cpu(0)>

def normal(loc=0, scale=1, shape=_Null, dtype=_Null, ctx=None, out=None, **kwargs):
    """Draw random samples from a normal (Gaussian) distribution.

    Samples are distributed according to a normal distribution parametrized
    by *loc* (mean) and *scale* (standard deviation).


    Parameters
    ----------
    loc : float or NDArray, optional
        Mean (centre) of the distribution.
    scale : float or NDArray, optional
        Standard deviation (spread or width) of the distribution.
    shape : int or tuple of ints, optional
        The number of samples to draw. If shape is, e.g., `(m, n)` and `loc` and
        `scale` are scalars, output shape will be `(m, n)`. If `loc` and `scale`
        are NDArrays with shape, e.g., `(x, y)`, then output will have shape
        `(x, y, m, n)`, where `m*n` samples are drawn for each `[loc, scale)` pair.
    dtype : {'float16', 'float32', 'float64'}, optional
        Data type of output samples. Default is 'float32'
    ctx : Context, optional
        Device context of output. Default is current context. Overridden by
        `loc.context` when `loc` is an NDArray.
    out : NDArray, optional
        Store output to an existing NDArray.

    Returns
    -------
    NDArray
        An NDArray of type `dtype`. If input `shape` has shape, e.g., `(m, n)` and
        `loc` and `scale` are scalars, output shape will be `(m, n)`. If `loc` and
        `scale` are NDArrays with shape, e.g., `(x, y)`, then output will have shape
        `(x, y, m, n)`, where `m*n` samples are drawn for each `[loc, scale)` pair.

    Examples
    --------
    >>> mx.nd.random.normal(0, 1)
    [ 2.21220636]
    <NDArray 1 @cpu(0)>
    >>> mx.nd.random.normal(0, 1, ctx=mx.gpu(0))
    [ 0.29253659]
    <NDArray 1 @gpu(0)>
    >>> mx.nd.random.normal(-1, 1, shape=(2,))
    [-0.2259962  -0.51619542]
    <NDArray 2 @cpu(0)>
    >>> loc = mx.nd.array([1,2,3])
    >>> scale = mx.nd.array([2,3,4])
    >>> mx.nd.random.normal(loc, scale, shape=2)
    [[ 0.55912292  3.19566321]
     [ 1.91728961  2.47706747]
     [ 2.79666662  5.44254589]]
    <NDArray 3x2 @cpu(0)>
    """
    return _random_helper(_internal._random_normal, _internal._sample_normal,
                          [loc, scale], shape, dtype, ctx, out, kwargs)