quantnn/generic/__init__.py
def expand_dims(module, array, dimension):
    """
    Expand tensor dimension along given axis.

    Inserts a dimension of length one at a given index of the
    dimension array.

    Args:
        module: Module object corresponding to the arrays.
        array: The array whose dimension to expand.
        dimension: The index at which to insert the new
            dimension.

    Returns:
        The reshaped array with a dimension added at the given index.
    """
    _import_modules()
    if module in [np, ma, jnp, tf]:
        return module.expand_dims(array, dimension)
    elif module == torch:
        return module.unsqueeze(array, dimension)
    raise UnknownModuleException(f"Module {module.__name__} not supported.")

    Expand tensor dimension along given axis.

    Inserts a dimension of length one at a given index of the
    dimension array.

    Args:
        module: Module object corresponding to the arrays.
        array: The array whose dimension to expand.
        dimension: The index at which to insert the new
            dimension.

    Returns:
        The reshaped array with a dimension added at the given index.
    
Expand tensor dimension along given axis.
Inserts a dimension of length one at a given index of the
dimension array.
Expand tensor dimension along given axis . Inserts a dimension of length one at a given index of the dimension array .
def expand_dims(module, array, dimension):
    _import_modules()
    if module in [np, ma, jnp, tf]:
        return module.expand_dims(array, dimension)
    elif module == torch:
        return module.unsqueeze(array, dimension)
    raise UnknownModuleException(f"Module {module.__name__} not supported.")
def expand_dims ( module , array , dimension ) : _import_modules ( ) if module in [ np , ma , jnp , tf ] : return module . expand_dims ( array , dimension ) elif module == torch : return module . unsqueeze ( array , dimension ) raise UnknownModuleException ( f"Module {module.__name__} not supported." )
Expand tensor dimension along given axis.
Expand tensor dimension along given axis .
"""
    Expand tensor dimension along given axis.

    Inserts a dimension of length one at a given index of the
    dimension array.

    Args:
        module: Module object corresponding to the arrays.
        array: The array whose dimension to expand.
        dimension: The index at which to insert the new
            dimension.

    Returns:
        The reshaped array with a dimension added at the given index.
    """
The reshaped array with a dimension added at the given index.
The reshaped array with a dimension added at the given index .
module
Module object corresponding to the arrays.
Module object corresponding to the arrays .
array
The array whose dimension to expand.
The array whose dimension to expand .
dimension
The index at which to insert the new
dimension.
The index at which to insert the new dimension .