CONF#
This module contains utility functions for configuration settings.
Functions#
- utils.conf.base_path(override=None)[source]#
Returns the base bath where to log accuracies and tensorboard data.
- Parameters:
override – the path to override the default one. Once set, it is stored and used for all the next calls.
- Returns:
./data/)
- Return type:
the base path (default
- utils.conf.create_seeded_dataloader(args, dataset, non_verbose=False, **dataloader_args)[source]#
Creates a dataloader object from a dataset, setting the seeds for the workers (if –seed is set).
- Parameters:
args – the arguments of the program
dataset – the dataset to be loaded
verbose – whether to print the number of workers
dataloader_args – external arguments of the dataloader
- Returns:
the dataloader object
- Return type:
- utils.conf.get_alloc_memory_all_devices(return_all=False)[source]#
Returns the memory allocated on all the available devices. By default, tries to return the memory read from pynvml, if available. Else, it returns the memory reserved by torch.
If return_all is set to True, it returns a tuple with the memory reserved, allocated and from pynvml.
Values are in Bytes.
- utils.conf.get_device(avail_devices=None)[source]#
Returns the least used GPU device if available else MPS or CPU.
- Return type:
- utils.conf.set_random_seed(seed)[source]#
Sets the seeds at a certain value.
- Parameters:
seed (int) – the value to be set