torchoutil.pyoutil.warnings module

deprecated_alias(alternative: ~typing.Callable[[~torchoutil.pyoutil.warnings.P], ~torchoutil.pyoutil.warnings.U], msg_fmt: str = "Deprecated call to '{fn_name}', use '{alternative_name}' instead.", warn_fn: ~typing.Callable[[str], ~typing.Any] = functools.partial(<functools._lru_cache_wrapper object>, category=<class 'DeprecationWarning'>)) Callable[[...], Callable[[P], U]][source]

Decorator to wrap deprecated aliases.

deprecated_function(msg_fmt: str = "Deprecated call to '{fn_name}'.", warn_fn: ~typing.Callable[[str], ~typing.Any] = functools.partial(<functools._lru_cache_wrapper object>, category=<class 'DeprecationWarning'>)) Callable[[Callable[[P], U]], Callable[[P], U]][source]

Decorator to wrap deprecated functions.

warn_once(
message: str,
category: Type[Warning] | None = None,
stacklevel: int = 1,
source: Any = None,
) None[source]
warn_once(
message: Warning,
category: Any = None,
stacklevel: int = 1,
source: Any = None,
) None

Warn message once using warnings module.