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

fix for typehints #844

Merged
merged 1 commit into from Mar 19, 2020
Merged

fix for typehints #844

merged 1 commit into from Mar 19, 2020

Conversation

sdesrozis
Copy link
Contributor

Fixes #842

def _to_hours_mins_secs(time_taken: Union[float, int]) -> Tuple[int, int, int]:
    """Convert seconds to hours, mins, and seconds."""
    mins, secs = divmod(time_taken, 60)
    hours, mins = divmod(mins, 60)
    return round(hours), round(mins), round(secs)

Added round.

Description:

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks !

@vfdev-5 vfdev-5 merged commit 0856f14 into pytorch:master Mar 19, 2020
@sdesrozis sdesrozis deleted the typehints_fix branch March 21, 2020 19:22
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.

Typehint of ignite._utils._to_hours_mins_secs not satisfied with float
2 participants