Shortcuts

ignite.utils#

Module with helper methods

ignite.utils.apply_to_tensor(input_, func)[source]#

Apply a function on a tensor or mapping, or sequence of tensors.

ignite.utils.apply_to_type(input_, input_type, func)[source]#

Apply a function on a object of input_type or mapping, or sequence of objects of input_type.

ignite.utils.convert_tensor(input_, device=None, non_blocking=False)[source]#

Move tensors to relevant device.

ignite.utils.to_onehot(indices, num_classes)[source]#

Convert a tensor of indices of any shape (N, …) to a tensor of one-hot indicators of shape (N, num_classes, …) and of type uint8. Output’s device is equal to the input’s device.