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, **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

  • dataloader_args – external arguments of the dataloader

Returns:

the dataloader object

Return type:

DataLoader

utils.conf.get_device()[source]#

Returns the least used GPU device if available else MPS or CPU.

Return type:

device

utils.conf.set_random_seed(seed)[source]#

Sets the seeds at a certain value.

Parameters:

seed (int) – the value to be set

utils.conf.set_random_seed_worker(worker_id)[source]#

Sets the seeds for a worker of a dataloader.

utils.conf.warn_once(*msg)[source]#

Prints a warning message only once.

Parameters:

msg – the message to be printed