kerncraft/kernel.py
def array_sizes(self, in_bytes=False, subs_consts=False):
        """
        Return a dictionary with all arrays sizes.

        :param in_bytes: If True, output will be in bytes, not element counts.
        :param subs_consts: If True, output will be numbers and not symbolic.

        Scalar variables are ignored.
        """
        var_sizes = {}

        for var_name, var_info in self.variables.items():
            var_type, var_size = var_info

            # Skiping sclars
            if var_size is None:
                continue

            var_sizes[var_name] = reduce(operator.mul, var_size, 1)

            # Multiply by bytes per element if requested
            if in_bytes:
                element_size = self.datatypes_size[var_type]
                var_sizes[var_name] *= element_size

        if subs_consts:
            return {k: self.subs_consts(v) for k, v in var_sizes.items()}
        else:
            return var_sizes
def array_sizes(self, in_bytes=False, subs_consts=False):
        var_sizes = {}

        for var_name, var_info in self.variables.items():
            var_type, var_size = var_info

            # Skiping sclars
            if var_size is None:
                continue

            var_sizes[var_name] = reduce(operator.mul, var_size, 1)

            # Multiply by bytes per element if requested
            if in_bytes:
                element_size = self.datatypes_size[var_type]
                var_sizes[var_name] *= element_size

        if subs_consts:
            return {k: self.subs_consts(v) for k, v in var_sizes.items()}
        else:
            return var_sizes
def array_sizes ( self , in_bytes = False , subs_consts = False ) : var_sizes = { } for var_name , var_info in self . variables . items ( ) : var_type , var_size = var_info # Skiping sclars if var_size is None : continue var_sizes [ var_name ] = reduce ( operator . mul , var_size , 1 ) # Multiply by bytes per element if requested if in_bytes : element_size = self . datatypes_size [ var_type ] var_sizes [ var_name ] *= element_size if subs_consts : return { k : self . subs_consts ( v ) for k , v in var_sizes . items ( ) } else : return var_sizes
Return a dictionary with all arrays sizes.

        :param in_bytes: If True, output will be in bytes, not element counts.
        :param subs_consts: If True, output will be numbers and not symbolic.

        Scalar variables are ignored.
Return a dictionary with all arrays sizes .