Utilities

hy2dl.utils.utils.set_random_seed(cfg: Config)

Set a seed for various packages to be able to reproduce the results.

Parameters:

cfg (Config) – Configuration file.

hy2dl.utils.utils.upload_to_device(sample: dict, device)

Upload the different tensors, contained in dictionaries, to the device (e.g. gpu).

Parameters:
  • cfg (Config) – Configuration file.

  • sample (dict) – Dictionary with the different tensors that will be used for the forward pass.