Skip to content

TEST: Fix failing pytype check for predict_segmentation#1762

Merged
wyli merged 1 commit intoProject-MONAI:masterfrom
adamaji:pytype-utils
Mar 13, 2021
Merged

TEST: Fix failing pytype check for predict_segmentation#1762
wyli merged 1 commit intoProject-MONAI:masterfrom
adamaji:pytype-utils

Conversation

@adamaji
Copy link
Copy Markdown
Contributor

@adamaji adamaji commented Mar 13, 2021

Description

It seems like 0bd86b1 (67b2b1d) introduces changes which don't pass the pytype check running ./runtests.sh -f -u --net --coverage. It's not clear to me why removing the cast in that commit should do this since the .int() should still return a torch.Tensor? But these changes make it so that pytype passes. Alternatively could do

return torch.Tensor((logits >= threshold).int())

in the function but not sure what the original commit was trying to do by removing the cast.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • 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.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@adamaji
Copy link
Copy Markdown
Contributor Author

adamaji commented Mar 13, 2021

cc @wyli for review

Copy link
Copy Markdown
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, the previous change was to address the pytype issue after upgrading to use torch 1.8.

@wyli wyli merged commit e17e158 into Project-MONAI:master Mar 13, 2021
@adamaji adamaji deleted the pytype-utils branch March 14, 2021 01:49
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.

2 participants