MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / wrapper

Function wrapper

imperative/python/megengine/utils/deprecation.py:24–34  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

22
23 @wraps(func)
24 def wrapper(*args, **kwargs):
25 nonlocal should_warning
26 if should_warning:
27 warnings.warn(
28 "Call to deprecated function {}. (use {}.{} instead) -- Deprecated since version {}.".format(
29 name, origin, name, version
30 ),
31 category=DeprecationWarning,
32 stacklevel=2,
33 )
34 return func(*args, **kwargs)
35
36 return wrapper
37

Callers

nothing calls this directly

Calls 2

funcFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected