calipy.utils

This module provides support functionality related to logging, data organization, preprocessing and other functions not directly related to calipy core domains.

The classes are
CalipyRegistry: Dictionary type class that is used for tracking identity

and uniqueness of objects created during a run and outputs warnings.

The script is meant solely for educational and illustrative purposes. Written by Dr. Jemil Avers Butt, Atlas optimization GmbH, www.atlasoptimization.com.

Functions

check_schema(calipy_dict_obj[, ...])

Example schema validation function:

context_plate_stack(plate_stack)

Context manager to handle multiple nested pyro.plate contexts.

dim_assignment(dim_names[, dim_sizes, ...])

dim_assignment dynamically assigns dimension objects to names and returns them as a DimTuple.

ensure_tuple(item)

Ensures the input is a tuple.

format_mro(cls)

generate_trivial_dims(ndim)

get_params(name)

multi_unsqueeze(input_tensor, dims)

restricted_exec(exec_string, allowed_locals)

robust_meshgrid(tensors[, indexing])

Ensures that meshgrid also works for empty inputs [] of sizes.

safe_eval(expr[, allowed_globals, ...])

Classes

CalipyDim(name[, size, description])

CalipyDim class contains information useful to manage dimensions and is the prime ingredient to DimTuple class which implements arithmentics on dimensions.

DimTuple(input_tuple)

DimTuple is a custom subclass of Python's tuple designed to manage and manipulate tuples of dimension objects, such as those from CalipyDim.

InputSchema(required_keys[, optional_keys, ...])

TorchdimTuple(input_tuple[, superior_dims])

TorchdimTuple is a subclass of the Tuple class that allows esy handling of tuples build from functorchdim.dim.Dim objects.