quantnn/generic/__init__.py
def numel(array):
    """
    Returns the number of elements in an array.

    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()
    module_name = type(array).__module__.split(".")[0]
    if module_name in ["numpy", "numpy.ma.core"]:
        return array.size
    elif module_name == "torch":
        return array.numel()
    elif module_name.split(".")[0] == "jax":
        return array.size
    elif module_name.split(".")[0] == "tensorflow":
        return tf.size(array)
    raise UnknownArrayTypeException(
        f"The provided input of type {type(x)} is" "not a supported array type."
    )

    Returns the number of elements in an array.

    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.
    
Returns the number of elements in an array.
Returns the number of elements in an array .
def numel(array):
    _import_modules()
    module_name = type(array).__module__.split(".")[0]
    if module_name in ["numpy", "numpy.ma.core"]:
        return array.size
    elif module_name == "torch":
        return array.numel()
    elif module_name.split(".")[0] == "jax":
        return array.size
    elif module_name.split(".")[0] == "tensorflow":
        return tf.size(array)
    raise UnknownArrayTypeException(
        f"The provided input of type {type(x)} is" "not a supported array type."
    )
def numel ( array ) : _import_modules ( ) module_name = type ( array ) . __module__ . split ( "." ) [ 0 ] if module_name in [ "numpy" , "numpy.ma.core" ] : return array . size elif module_name == "torch" : return array . numel ( ) elif module_name . split ( "." ) [ 0 ] == "jax" : return array . size elif module_name . split ( "." ) [ 0 ] == "tensorflow" : return tf . size ( array ) raise UnknownArrayTypeException ( f"The provided input of type {type(x)} is" "not a supported array type." )
Returns the number of elements in an array.
Returns the number of elements in an array .
"""
    Returns the number of elements in an array.

    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 .
array
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 .