persia.utils
Module Contents
- persia.utils.dump_yaml(content, filepath)
Dump the content into filepath.
- Parameters:
content (dict) –
filepath (str) –
- persia.utils.find_free_port(port=10000, interval=1)
Check current input port is available or not. It will add the interval to input port utils the the new port is available.
- Parameters:
port (int) –
interval (int) –
- Return type:
int
- persia.utils.load_yaml(filepath)
Load the yaml config by provided filepath.
- Parameters:
filepath (str) – yaml config path.
- Return type:
dict
- persia.utils.resolve_binary_execute_path(binary_name)
Resolved executable file under persia package root.
- Parameters:
binary_name (str) –
- Return type:
str
- persia.utils.run_command(cmd, env=None)
- Parameters:
cmd (List[str]) –
env (Optional[dict]) –
- persia.utils.setup_seed(seed)
Set the random seed for dependencies to ensure that experiments are reproducible.
- Parameters:
seed (int) – integer to use as seed for random number generator used by random, NumPy and pyTorch.
- persia.utils.MAXIMUM_LOCAL_PORT_NUM :int = 65535