Skip to content

Commit

Permalink
is_autocast_enabled: fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Aug 13, 2024
1 parent 929d1b2 commit 1e467be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kornia/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def is_autocast_enabled(both: bool = True) -> bool:
Returns:
Return a Bool,
will always return False for a torch without support, otherwise will be: if both is True
`torch.is_autocast_enabled() or torch.is_autocast_cpu_enabled()`. If both is False will return just
`torch.is_autocast_enabled() or torch.is_autocast_enabled('cpu')`. If both is False will return just
`torch.is_autocast_enabled()`.
"""
if TYPE_CHECKING:
Expand All @@ -316,7 +316,7 @@ def is_autocast_enabled(both: bool = True) -> bool:
return False

if both:
return torch.is_autocast_enabled() or torch.is_autocast_cpu_enabled()
return torch.is_autocast_enabled() or torch.is_autocast_enabled("cpu")

return torch.is_autocast_enabled()

Expand Down

0 comments on commit 1e467be

Please sign in to comment.