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

Add raise statement before ValueError #3530

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bindings/python/cntk/ops/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ def train(self, minibatch_source,
else:
config[0] = cb
else:
ValueError('callbacks list can only contain objects of type ProgressWriter, CheckpointConfig, CrossValidationConfig, and TestConfig.')
raise ValueError('callbacks list can only contain objects of type ProgressWriter, CheckpointConfig, CrossValidationConfig, and TestConfig.')

Choose a reason for hiding this comment

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

Is there a benefit?

# use a progress tracker to capture the loss, metric, and count values
if progress_frequency is None and epoch_size is not None: # if epoch size is given then default training summary frequency to it
progress_frequency = epoch_size
Expand Down Expand Up @@ -1528,7 +1528,7 @@ def test(self, minibatch_source, minibatch_size=32, streams=None, model_inputs_t
# callbacks. Only ProgressWriter is allowed in test()
from ..cntk_py import ProgressWriter
if callbacks and any(not isinstance(cb, ProgressWriter) for cb in callbacks):
ValueError('callbacks list must only contain objects of type ProgressWriter')
raise ValueError('callbacks list must only contain objects of type ProgressWriter')
progress_writers = callbacks or []
evaluator = Evaluator(output, progress_writers + [collector])

Expand Down