Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Update implementation of PDARTS export due to mutator refactor (#2423)
Browse files Browse the repository at this point in the history
* Disable precondition check for length in export for PDARTS

* update
  • Loading branch information
ultmaster authored May 14, 2020
1 parent 4b5e915 commit 529a289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sdk/pynni/nni/nas/pytorch/pdarts/mutator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def __init__(self, model, pdarts_epoch_index, pdarts_num_to_drop, switches={}):
del module[index]
assert len(module) <= len(choices), "Failed to remove dropped choices."

def sample_final(self):
def export(self):
# Cannot rely on super().export() because P-DARTS has deleted some of the choices and has misaligned length.
results = super().sample_final()
for mutable in self.mutables:
if isinstance(mutable, LayerChoice):
Expand Down

0 comments on commit 529a289

Please sign in to comment.