-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
remove frame inspection on self.hparams #2253
Conversation
Hello @williamFalcon! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-19 02:36:49 UTC |
lines = class_code.split('\n') | ||
for line in lines: | ||
line = re.sub(r"\s+", "", line, flags=re.UNICODE) | ||
if 'self.hparams=' in line: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a naive hack assuming user uses standard naming, it will fail on
class AAA(...):
def __init__(me, param1, ...):
me.hparams = param1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope... 'hparams' is a fallback... try it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point is with rename self
to me
or what ever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also what about spacing
self.hparams <50x spaces> = param1
or rename the vasiable
class AAA():
def __init__(me, param1):
copy_param = copy.deepcopy(param1)
me.hparams = copy_param
Fixes #2250
Fixes #2188