ptyrad.utils.dev_tools#
Developer tools for logging, testing, checking sizes and types, etc.
Functions
|
Check if the modes in tensor (Nmodes, []) is orthogonal to each other |
|
Check if a torch.Tensor contains any NaN or Inf values. |
|
print_package_tree prints the package structure with module, class, method, and function definitions for a concise view of the entire package structure |
|
Test run of the constraint_fn |
|
Print loss values for each term for convenient weight tuning |
- ptyrad.utils.dev_tools.print_package_tree(package_path)[source]#
print_package_tree prints the package structure with module, class, method, and function definitions for a concise view of the entire package structure
- Parameters:
package_path (str) – package_path (str): Path to the target package
- ptyrad.utils.dev_tools.has_nan_or_inf(tensor)[source]#
Check if a torch.Tensor contains any NaN or Inf values.
- Parameters:
tensor (torch.Tensor) – Input tensor to check.
- Returns:
True if the tensor contains any NaN or Inf values, False otherwise.
- Return type:
bool
- ptyrad.utils.dev_tools.check_modes_ortho(tensor, rtol=0.001)[source]#
Check if the modes in tensor (Nmodes, []) is orthogonal to each other