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

[trainer] improve code readability #8903

Merged
merged 2 commits into from
Dec 2, 2020
Merged

[trainer] improve code readability #8903

merged 2 commits into from
Dec 2, 2020

Conversation

stas00
Copy link
Contributor

@stas00 stas00 commented Dec 2, 2020

This PR:

  • removes redundant code, as:
self.model = model if model is not None else None

and

self.model = model

are the same.

  • decouples attribute assignment from code logic - which simplifies things further.

@sgugger, @LysandreJik

This PR:
- removes redundant code 
```
self.model = model if model is not None else None
```
and
```
self.model = model
```
are the same.

* separate attribute assignment from code logic - which simplifies things further.
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@stas00 stas00 merged commit 7e1cb00 into master Dec 2, 2020
@stas00 stas00 deleted the stas00-patch-2 branch December 2, 2020 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants