quantnn/generic/__init__.py
def zeros(module, shape, like=None):
    """
    Zero tensor of given shape.

    Arguments:
        module: The backend array corresponding to the given array.
        shape: Tuple defining the desired shape of the tensor to create.
        like: Optional tensor to use to determine additional properties
            such as data type, device, etc ...

    Return:
         Zero tensor of given shape.
    """
    _import_modules()
    if module in [np, ma]:
        if like is not None:
            return module.zeros(shape, dtype=like.dtype)
        else:
            return module.zeros(shape)
    elif module == torch:
        if like is not None:
            return module.zeros(shape, dtype=like.dtype, device=like.device)
        else:
            return module.zeros(shape)
    elif module == jnp:
        return module.zeros(shape)
    elif module == tf:
        return module.zeros(shape)
    raise UnknownModuleException(f"Module {module.__name__} not supported.")

    Zero tensor of given shape.

    Arguments:
        module: The backend array corresponding to the given array.
        shape: Tuple defining the desired shape of the tensor to create.
        like: Optional tensor to use to determine additional properties
            such as data type, device, etc ...

    Return:
         Zero tensor of given shape.
    
Zero tensor of given shape.
Zero tensor of given shape .
def zeros(module, shape, like=None):
    _import_modules()
    if module in [np, ma]:
        if like is not None:
            return module.zeros(shape, dtype=like.dtype)
        else:
            return module.zeros(shape)
    elif module == torch:
        if like is not None:
            return module.zeros(shape, dtype=like.dtype, device=like.device)
        else:
            return module.zeros(shape)
    elif module == jnp:
        return module.zeros(shape)
    elif module == tf:
        return module.zeros(shape)
    raise UnknownModuleException(f"Module {module.__name__} not supported.")
def zeros ( module , shape , like = None ) : _import_modules ( ) if module in [ np , ma ] : if like is not None : return module . zeros ( shape , dtype = like . dtype ) else : return module . zeros ( shape ) elif module == torch : if like is not None : return module . zeros ( shape , dtype = like . dtype , device = like . device ) else : return module . zeros ( shape ) elif module == jnp : return module . zeros ( shape ) elif module == tf : return module . zeros ( shape ) raise UnknownModuleException ( f"Module {module.__name__} not supported." )
Zero tensor of given shape.
Zero tensor of given shape .
"""
    Zero tensor of given shape.

    Arguments:
        module: The backend array corresponding to the given array.
        shape: Tuple defining the desired shape of the tensor to create.
        like: Optional tensor to use to determine additional properties
            such as data type, device, etc ...

    Return:
         Zero tensor of given shape.
    """
module
The backend array corresponding to the given array.
The backend array corresponding to the given array .
shape
Tuple defining the desired shape of the tensor to create.
Tuple defining the desired shape of the tensor to create .
like
Optional tensor to use to determine additional properties
such as data type, device, etc
Optional tensor to use to determine additional properties such as data type device etc