Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed decor to show messages only when the wrapped object is called. #6793

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions nemo/utils/decorators/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@

__all__ = ['experimental']

from nemo.utils import logging


def experimental(cls):
""" Decorator which indicates that module is experimental.
Use it to mark experimental or research modules.
"""
import wrapt

def wrapped(cls):
logging.warning(
f'Module {cls} is experimental, not ready for production and is not fully supported. Use at your own risk.'
)
from nemo.utils import logging

return cls

return wrapped(cls=cls)
@wrapt.decorator
def experimental(wrapped, instance, args, kwargs):
logging.warning(f"`{wrapped}` is experimental and not ready for production yet. Use at your own risk.")
return wrapped(*args, **kwargs)
Loading