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

Update implementation of PDARTS export due to mutator refactor #2423

Merged
merged 2 commits into from
May 14, 2020
Merged
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
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