Skip to content

Commit

Permalink
refine the code test=develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchaochaohu committed Aug 16, 2020
1 parent aa24075 commit 89c8635
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/paddle/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ def get_cudnn_version():
"""
global _cudnn_version
if _cudnn_version is None and core.is_compiled_with_cuda():
cudnn_version = core.cudnn_version()
if cudnn_version < 0:
if not core.is_compiled_with_cuda():
return None
if _cudnn_version is None:
cudnn_version = int(core.cudnn_version())
_cudnn_version = cudnn_version
if _cudnn_version < 0:
return None
else:
return cudnn_version
Expand Down

1 comment on commit 89c8635

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

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

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.