Skip to content

Commit

Permalink
refactor&fixbug for resnet NAS
Browse files Browse the repository at this point in the history
  • Loading branch information
marsggbo committed Jan 27, 2023
1 parent 4bb0661 commit 2af2473
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hyperbox/mutables/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,15 @@ def sortIdx(self, indices):
indices = torch.tensor(indices)
self._sortIdx = indices

def __mul__(self, other: int):
candidates = [c * other for c in self.candidates]
mask = self.mask if not self.is_search else None
index = self.index if not self.is_search else None
return ValueSpace(candidates, mask=mask, index=index, key=self.key)

def __rmul__(self, other: int):
return self.__mul__(other)


if __name__ == '__main__':
# mask = {'test': torch.tensor([0.5,0.3,0.2,0.1])}
Expand Down

0 comments on commit 2af2473

Please sign in to comment.