carpedm20 / ENAS-pytorch

PyTorch implementation of "Efficient Neural Architecture Search via Parameters Sharing"
Apache License 2.0
2.69k stars 492 forks source link

set default of `valid_idx` to 0 in `get_reward` #30

Closed nkcr closed 5 years ago

nkcr commented 5 years ago

The value of valid_idx would always be overwritten by the if block. I think the author intended to write:

if not valid_idx:
    valid_idx = 0

But forgot the not in the condition. In fact instead of adding the not we can get rid of the if block and set the valid_idx parameter to a default value of 0.

Before this update, omitting to give the optional parameter valid_idx would produce an exception.

carpedm20 commented 5 years ago

Thanks for the PR!