fastai / course-v3

The 3rd edition of course.fast.ai
https://course.fast.ai/
Apache License 2.0
4.9k stars 3.55k forks source link

Fix callback loop logic #417

Closed gnoparus closed 5 years ago

gnoparus commented 5 years ago

The logic is at least one callback return true __call__ will return true. But using "and" the method will always return False.

    for cb in sorted(self.cbs, key=lambda x: x._order): res = cb(cb_name) and res

change to "or"

    for cb in sorted(self.cbs, key=lambda x: x._order): res = cb(cb_name) or res
review-notebook-app[bot] commented 5 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

gnoparus commented 5 years ago

Duplicated with https://github.com/fastai/course-v3/pull/418