torchtable.utils module¶
Module contents¶
-
torchtable.utils.apply_oneormore(func, x: Union[T, Iterable[T]]) → Union[T, Iterable[T]]¶ Returns multiple outputs for multiple inputs and a single output for a single input, applying the same function in either case.
-
torchtable.utils.expand(a: Union[T, Iterable[T]], n: int) → Iterable¶ Turn 1 or n objects to n objects by repeating if necessary
-
torchtable.utils.flat_filter(itr: Iterable[Union[T, Iterable[T]]], predicate: Callable[T, bool]) → Iterable[T]¶
-
torchtable.utils.fold_oneormore(func: Callable[[T, T], T], x: Union[T, Iterable[T]], init: T) → Any¶ Aggregates multiple inputs by folding, simply applies for a single input.
-
torchtable.utils.to_numpy_array(x: Union[pandas.core.series.Series, numpy.core.multiarray.array]) → numpy.core.multiarray.array¶ Extracts numpy array from an ArrayLike object
-
torchtable.utils.with_default(x: Optional[T], default: T) → T¶