ptyrad.utils.dev_tools

ptyrad.utils.dev_tools#

Developer tools for logging, testing, checking sizes and types, etc.

Functions

check_modes_ortho(tensor[, atol])

Check if the modes in tensor (Nmodes, []) is orthogonal to each other

get_size_bytes(x)

has_nan_or_inf(tensor)

Check if a torch.Tensor contains any NaN or Inf values.

print_package_tree(package_path)

print_package_tree prints the package structure with module, class, method, and function definitions for a concise view of the entire package structure

test_constraint_fn(test_model, ...)

Test run of the constraint_fn

test_loss_fn(model, indices, loss_fn)

Print loss values for each term for convenient weight tuning

yaml2json(input_filepath, output_filepath)