Skip to content

Commit 17e0c3f

Browse files
Asma Kuriparambil ThekkumpaterealAsma
authored andcommitted
[1/N] Refactored AutoQuantizeSearcher to _AutoQuantizeBaseSearcher & AutoQuantizeGradientSearcher; seperated quant modules and score modules
Signed-off-by: realAsma <[email protected]> minor Signed-off-by: realAsma <[email protected]>
1 parent a703e22 commit 17e0c3f

File tree

6 files changed

+493
-282
lines changed

6 files changed

+493
-282
lines changed

modelopt/torch/opt/hparam.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,14 @@ def _enforce_order(self, order: torch.Tensor | None = None) -> None:
249249
order = order.cpu()
250250
self._slice_order = order
251251

252+
@property
253+
def attrs(self) -> list[str]:
254+
"""Return the attributes of the hparam for repr."""
255+
return ["choices", "active", "original"]
256+
252257
def __repr__(self) -> str:
253258
"""Return string representation with relevant properties of the class."""
254-
attrs = ["choices", "active", "original"]
255-
return f"{type(self).__name__}({', '.join(f'{x}={getattr(self, x)}' for x in attrs)})"
259+
return f"{type(self).__name__}({', '.join(f'{x}={getattr(self, x)}' for x in self.attrs)})"
256260

257261
def __iand__(self, hp: "Hparam"):
258262
"""Merge another hparam into self."""

0 commit comments

Comments
 (0)