pytorch_forecasting.utils.
apply_to_list
Apply function to a list of objects or directly if passed value is not a list.
This is useful if the passed object could be either a list to whose elements a function needs to be applied or just an object to whicht to apply the function.
obj (Union[List[Any], Any]) – list/tuple on whose elements to apply function, otherwise object to whom to apply function
func (Callable) – function to apply
if input obj is of type list/tuple
obj
Union[List[Any], Any]