Skip to content

Commit 3011685

Browse files
committed
fix(tracker): reduction pt per layer
1 parent 8407c8a commit 3011685

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

activationscope/tracker.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,15 @@ def register_reduction(
183183
if dummy_acc is None:
184184
dummy_acc = torch.randn(64, dtype=torch.float32)
185185

186-
reduction_path = export_reduction(fn, dummy_acc, dummy_tensor)
187-
self._temp_files.append(reduction_path)
188-
189186
if layers is None:
187+
reduction_path = export_reduction(fn, dummy_acc, dummy_tensor)
188+
self._temp_files.append(reduction_path)
190189
self._global_reduction_path = reduction_path
191190
else:
192-
self._reductions.append((reduction_path, layers))
191+
for layer in layers:
192+
reduction_path = export_reduction(fn, dummy_acc, dummy_tensor)
193+
self._temp_files.append(reduction_path)
194+
self._reductions.append((reduction_path, [layer]))
193195

194196
# ── Built-in reduction factories ──────────────────────────────
195197

utils/generate-pyproject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def generate(template: str, combos: List[Dict[str, str]]) -> str:
4646
text = text.replace("__TORCH_VERSION__", torch_floor)
4747
text = text.replace(
4848
"__VERSION__",
49-
os.environ.get("ASCOPE_VERSION", "0.1.0"),
49+
os.environ.get("ASCOPE_VERSION", "0.1.1"),
5050
)
5151
text = text.replace("__PYTHON_CLASSIFIERS__", classifiers + ",\n")
5252

0 commit comments

Comments
 (0)