Skip to content

Conversation

@charliebudd
Copy link
Collaborator

@charliebudd charliebudd commented Mar 29, 2021

Description

Fixes Error cause by incorrect use of ctx.save_for_backwards to save non pytorch variable or tensor objects. Changed the code to save parameters as normal attributes of ctx. Also returning None for the gradients of these parameters as they are not currently learnable.

Unit tests have been added to check the backwards function no longer throws errors.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.

…pass

Signed-off-by: chaliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: chaliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: chaliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: chaliebudd <charles.budd@kcl.ac.uk>
@charliebudd charliebudd marked this pull request as ready for review March 29, 2021 11:31
@charliebudd charliebudd requested a review from wyli March 29, 2021 11:31
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks!

@wyli wyli enabled auto-merge (squash) March 29, 2021 22:48
@wyli wyli disabled auto-merge March 30, 2021 09:32
@wyli wyli merged commit a397e5d into Project-MONAI:master Mar 30, 2021
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.

3 participants