Class provides the following utility functions:
More...
|
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.
|
|
Class provides the following utility functions:
- load_tensor
- load_yaml
- load_toml
Definition at line 50 of file io_utils.py.
◆ 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
-
- Returns
-
tensor The loaded tensor
-
None If the file does not exist
- Exceptions
-
FileNotFoundError | If 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
-
- Returns
-
data The loaded data
- Exceptions
-
FileNotFoundError | If 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.