Shortcuts

ApplyToKeys

class flash.core.data.transforms.ApplyToKeys(keys, *args)[source]

The ApplyToKeys class is an nn.Sequential which applies the given transforms to the given keys from the input. When a single key is given, a single value will be passed to the transforms. When multiple keys are given, the corresponding values will be passed to the transforms as a list.

Parameters
  • keys (Union[str, Sequence[str]]) – The key (str) or sequence of keys (Sequence[str]) to extract and forward to the transforms.

  • args – The transforms, passed to the nn.Sequential super constructor.