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

refactoring: early return 'if else' -> 'if' #38301

Merged
merged 1 commit into from
Apr 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions tensorflow/python/distribute/combinations.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,13 @@ def should_execute_combination(self, kwargs):

if not number_of_required_tpus and TPUCombination.TPU_TEST:
return (False, "Test that doesn't require TPUs.")
elif number_of_required_tpus and not TPUCombination.TPU_TEST:
if number_of_required_tpus and not TPUCombination.TPU_TEST:
return (False, "Test requires a TPU, but it's not available.")
elif use_cloud_tpu and not tpu:
if use_cloud_tpu and not tpu:
return (False, "Test requires a Cloud TPU, but none specified.")
elif not use_cloud_tpu and tpu:
if not use_cloud_tpu and tpu:
return (False, "Test requires local TPU, but Cloud TPU specified.")
else:
return (True, None)
return (True, None)

def parameter_modifiers(self):
return [
Expand Down