quantnn/generic/__init__.py
def sample_gaussian(module, shape):
    """
    Create a tensor with random values sampled from a Gaussian distribution.

    Args:
         module: Module representing the module which should be used as
             backend.
         shape: Iterable describing the shape of tensor.

    Returns:
         Array object corresponding to the given module object containing
         random values.
    """
    _import_modules()
    if module in [np, ma]:
        return module.random.randn(*shape)
    elif module == torch:
        return module.randn(*shape)
    elif module == jnp:
        return jax.random.normal(_JAX_KEY, shape)
    elif module == tf:
        return tf.random.normal(shape)
    return UnknownModuleException(f"Module {module.__name__} not supported.")

    Create a tensor with random values sampled from a Gaussian distribution.

    Args:
         module: Module representing the module which should be used as
             backend.
         shape: Iterable describing the shape of tensor.

    Returns:
         Array object corresponding to the given module object containing
         random values.
    
Create a tensor with random values sampled from a Gaussian distribution.
Create a tensor with random values sampled from a Gaussian distribution .
def sample_gaussian(module, shape):
    _import_modules()
    if module in [np, ma]:
        return module.random.randn(*shape)
    elif module == torch:
        return module.randn(*shape)
    elif module == jnp:
        return jax.random.normal(_JAX_KEY, shape)
    elif module == tf:
        return tf.random.normal(shape)
    return UnknownModuleException(f"Module {module.__name__} not supported.")
def sample_gaussian ( module , shape ) : _import_modules ( ) if module in [ np , ma ] : return module . random . randn ( * shape ) elif module == torch : return module . randn ( * shape ) elif module == jnp : return jax . random . normal ( _JAX_KEY , shape ) elif module == tf : return tf . random . normal ( shape ) return UnknownModuleException ( f"Module {module.__name__} not supported." )
Create a tensor with random values sampled from a Gaussian distribution.
Create a tensor with random values sampled from a Gaussian distribution .
"""
    Create a tensor with random values sampled from a Gaussian distribution.

    Args:
         module: Module representing the module which should be used as
             backend.
         shape: Iterable describing the shape of tensor.

    Returns:
         Array object corresponding to the given module object containing
         random values.
    """
Array object corresponding to the given module object containing
random values.
Array object corresponding to the given module object containing random values .
module
Module representing the module which should be used as
backend.
Module representing the module which should be used as backend .
shape
Iterable describing the shape of tensor.
Iterable describing the shape of tensor .