Skip to content

Commit 8dbf83a

Browse files
committed
Added wrapper for reset and advance_state
1 parent 9b75266 commit 8dbf83a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ngclearn/components/base_monitor.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ class Base_Monitor(Component):
4444
"""
4545
auto_resolve = False
4646

47+
@staticmethod
48+
def build_reset(component):
49+
return Base_Monitor.reset(component)
50+
51+
@staticmethod
52+
def build_advance_state(component):
53+
return Base_Monitor.record(component)
54+
4755
@staticmethod
4856
def _record_internal(compartments):
4957
"""

ngclearn/components/monitor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Monitor(Base_Monitor):
66
A jax implementation of `Base_Monitor`. Designed to be used with all
77
non-lava ngclearn components
88
"""
9+
auto_resolve = False
910

1011
@staticmethod
1112
def _record_internal(compartments):
@@ -20,3 +21,11 @@ def _record(**kwargs):
2021
return_vals.append(current_store)
2122
return return_vals if len(compartments) > 1 else return_vals[0]
2223
return _record
24+
25+
@staticmethod
26+
def build_advance_state(component):
27+
return super().build_advance_state(component)
28+
29+
@staticmethod
30+
def build_reset(component):
31+
return super().build_reset(component)

0 commit comments

Comments
 (0)