Skip to content

Commit df6fdd3

Browse files
Fix issue with LSTM state variables initialization (#1264)
* Fix issue with LSTM state variables initialization Signed-off-by: Buddha Puneeth Nandanoor <[email protected]> * Fix issue with LSTM state variables initialization Signed-off-by: Buddha Puneeth Nandanoor <[email protected]>
1 parent e853156 commit df6fdd3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tf2onnx/rewriter/lstm_rewriter_base.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ class LSTMRewriterBase(UnitRnnRewriterBase):
4747
3 process found info according to ONNX requirement
4848
"""
4949

50-
def __init__(self, g):
51-
super(LSTMRewriterBase, self).__init__(g)
52-
# {var_name: (finder, connector)}
53-
self.state_variable_handler = list()
54-
self.state_variable_handlers = list()
55-
5650
def create_context(self):
5751
return LSTMContext()
5852

@@ -66,6 +60,8 @@ def parse_unit_rnn(self, context):
6660
5 attributes, e.g., activation_alpha, activation_beta... optional
6761
"""
6862
logger.debug("parse unit rnn")
63+
self.state_variable_handler = list()
64+
self.state_variable_handlers = list()
6965

7066
logger.debug("match unit cell against loop body graph")
7167
cell_match = self.find_cell(context)

0 commit comments

Comments
 (0)