Skip to content

Commit 1e0296d

Browse files
committed
Fix issue with LSTM state variables initialization
1 parent 848a2ca commit 1e0296d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tf2onnx/rewriter/lstm_rewriter_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ class LSTMRewriterBase(UnitRnnRewriterBase):
4949

5050
def __init__(self, g):
5151
super(LSTMRewriterBase, self).__init__(g)
52-
# {var_name: (finder, connector)}
53-
self.state_variable_handler = list()
54-
self.state_variable_handlers = list()
5552

5653
def create_context(self):
5754
return LSTMContext()
@@ -66,6 +63,8 @@ def parse_unit_rnn(self, context):
6663
5 attributes, e.g., activation_alpha, activation_beta... optional
6764
"""
6865
logger.debug("parse unit rnn")
66+
self.state_variable_handler = list()
67+
self.state_variable_handlers = list()
6968

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

0 commit comments

Comments
 (0)