kliff.utils#

kliff.utils.length_equal(a, b)[source]#
kliff.utils.torch_available()[source]#
kliff.utils.split_string(string, length=80, starter=None)[source]#

Insert n into long string such that each line has size no more than length.

Parameters
  • string (str) – The string to split.

  • length – Targeted length of the each line.

  • starter (Optional[str]) – String to insert at the beginning of each line.

kliff.utils.seed_all(seed=35, cudnn_benchmark=False, cudnn_deterministic=False)[source]#
kliff.utils.to_path(path)[source]#

Convert str (or filename) to pathlib.Path.

Return type

Path

kliff.utils.download_dataset(dataset_name)[source]#

Download dataset and untar it.

Parameters

dataset_name (str) – name of the dataset

Return type

Path

Returns

Path to the dataset

kliff.utils.create_directory(path, is_directory=False)[source]#
kliff.utils.yaml_dump(data, filename)[source]#

Dump data to a yaml file.

kliff.utils.yaml_load(filename)[source]#

Load data from a yaml file.

kliff.utils.pickle_dump(data, filename)[source]#

Dump data to a pickle file.

kliff.utils.pickle_load(filename)[source]#

Load data from a pikel file.