Skip to content

Add on_predict_{batch,epoch}_{start,end} and Callback.on_predict_{start,end}#7141

Merged
lexierule merged 9 commits intomasterfrom
typing-hooks
Apr 22, 2021
Merged

Add on_predict_{batch,epoch}_{start,end} and Callback.on_predict_{start,end}#7141
lexierule merged 9 commits intomasterfrom
typing-hooks

Conversation

@carmocca
Copy link
Copy Markdown
Contributor

@carmocca carmocca commented Apr 21, 2021

What does this PR do?

Split out from #7042 and #7127

Notes:

  • self.log is not allowed in the predict hooks

cc: @justusschock @tchaton

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • [n/a] Did you make sure to update the documentation with your changes? (if necessary)
  • [n/a] Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@carmocca carmocca added feature Is an improvement or enhancement refactor labels Apr 21, 2021
@carmocca carmocca added this to the v1.3 milestone Apr 21, 2021
@carmocca carmocca requested a review from williamFalcon as a code owner April 21, 2021 18:20
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2021

Codecov Report

Merging #7141 (43a5475) into master (1477520) will decrease coverage by 6%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #7141    +/-   ##
=======================================
- Coverage      92%     86%    -6%     
=======================================
  Files         197     197            
  Lines       12662   12796   +134     
=======================================
- Hits        11674   11059   -615     
- Misses        988    1737   +749     

Copy link
Copy Markdown
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !
Need to add the calls on trainer callbacks too for the new ones.

@carmocca carmocca self-assigned this Apr 21, 2021
@carmocca carmocca mentioned this pull request Apr 21, 2021
11 tasks
@Borda Borda requested a review from tchaton April 21, 2021 23:34
Comment thread pytorch_lightning/callbacks/lambda_function.py
Comment thread pytorch_lightning/callbacks/progress.py
@carmocca carmocca changed the title Update hooks typing and add some predict hooks Add on_predict_{batch,epoch}_{start,end} and Callback.on_predict_{start,end} Apr 22, 2021
Copy link
Copy Markdown
Contributor

@tchaton tchaton 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.

Comment thread pytorch_lightning/callbacks/lambda_function.py
Comment thread tests/trainer/logging_/test_logger_connector.py Outdated
Comment thread tests/callbacks/test_lambda_function.py Outdated
@carmocca carmocca added ready to be merged PRs ready to be merged admin Requires admin privileges to merge labels Apr 22, 2021
@carmocca carmocca added design Includes a design discussion and removed refactor labels Apr 22, 2021
@lexierule lexierule merged commit 33066f8 into master Apr 22, 2021
@lexierule lexierule deleted the typing-hooks branch April 22, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admin Requires admin privileges to merge design Includes a design discussion feature Is an improvement or enhancement ready to be merged PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants