Coverage Control Library
Loading...
Searching...
No Matches
IOUtils Class Reference

Class provides the following utility functions: More...

Static Public Member Functions

str sanitize_path (str path_str)
 Function to sanitize a path string.
 
torch.tensor load_tensor ((str, pathlib.Path) path)
 Function to load a tensor from a file Can load tensors from jit script format files.
 
dict load_yaml (str path)
 Function to load a yaml file.
 
dict load_toml (str path)
 Function to load a toml file.
 

Detailed Description

Class provides the following utility functions:

- load_tensor
- load_yaml
- load_toml

Definition at line 50 of file io_utils.py.

Member Function Documentation

◆ load_tensor()

torch.tensor load_tensor ( (str, pathlib.Path) path)
static

Function to load a tensor from a file Can load tensors from jit script format files.

Parameters
pathPath to the file
Returns
tensor The loaded tensor
None If the file does not exist
Exceptions
FileNotFoundErrorIf the file does not exist

Definition at line 75 of file io_utils.py.

◆ load_toml()

dict load_toml ( str path)
static

Function to load a toml file.

Definition at line 125 of file io_utils.py.

◆ load_yaml()

dict load_yaml ( str path)
static

Function to load a yaml file.

Parameters
pathPath to the file
Returns
data The loaded data
Exceptions
FileNotFoundErrorIf the file does not exist

Definition at line 108 of file io_utils.py.

◆ sanitize_path()

str sanitize_path ( str path_str)
static

Function to sanitize a path string.

Definition at line 56 of file io_utils.py.