tasks.utils package

Submodules

tasks.utils.outputs module

class OutputKeys(value)[source]

Bases: StrEnum

Enum class for the keys of the output dictionary.

LOG = 'logs'
LOSS = 'loss'
PREDICTION = 'pred'
TARGET = 'target'
reduce_dict(input_dict: Dict, key_list: List) Dict[source]

Reduce the input dictionary to only contain the keys in the key_list.

Parameters:
  • input_dict (Dict) – The dictionary to reduce

  • key_list (List) – List of keys to keep

Returns:

The dictionary input_dict with only the keys in the key_list

Return type:

Dict

save_numpy_files(trainer, test_output_path, input_idx, output)[source]

tasks.utils.task_utils module

get_callable_dict(fn: Union[Callable, Mapping, Sequence]) Union[Dict, Mapping][source]

Creates a dictionary with the name of the callable as key and the callable as value.

Parameters:

fn (Union[Callable, Mapping, Sequence]) – Callable, sequence or mapping we want to convert to a dictionary

Returns:

A dictionary with the name of the callable as key and the callable as value

Return type:

Union[Dict, Mapping]

get_callable_name(fn_or_class: Union[Callable, Sequence, object]) str[source]

Get the name of a callable or class.

Parameters:

fn_or_class (Union[Callable, Sequence, object]) – Callable, class or sequence we want the name of

Returns:

the name of the callable or class

Return type:

str

print_merge_tool_info(trainer: Trainer, test_output_path: str, data_format: str)[source]

Module contents