Skip to content

Commit

Permalink
[keras/benchmarks/benchmark_util.py] Use var rather than string liter…
Browse files Browse the repository at this point in the history
…al for `is None` checks on `measure_performance`
  • Loading branch information
SamuelMarks committed Apr 13, 2023
1 parent a90cb90 commit f7de756
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions keras/benchmarks/benchmark_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ def measure_performance(
ValueError: If `x` is none or if `optimizer` is not provided or
if `loss` is not provided or if `num_gpus` is negative.
"""
if "x" is None:
if x is None:
raise ValueError("Input data is required.")
if "optimizer" is None:
elif optimizer is None:
raise ValueError("Optimizer is required.")
if "loss" is None:
elif loss is None:
raise ValueError("Loss function is required.")
if num_gpus < 0:
elif num_gpus < 0:
raise ValueError("`num_gpus` cannot be negative")

# TODO(xingyulong): we will add tfds support later and
Expand Down

0 comments on commit f7de756

Please sign in to comment.