File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
pybrain/structure/modules Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ def _resetBuffers(self, length=1):
5454 """Reset buffers to a length (in time dimension) of 1."""
5555 for buffername , dim in self .bufferlist :
5656 setattr (self , buffername , zeros ((length , dim )))
57+ if length == 1 :
58+ self .offset = 0
5759
5860 def _growBuffers (self ):
5961 """Double the size of the modules buffers in its first dimension and
@@ -92,7 +94,7 @@ def shift(self, items):
9294 if items == 0 :
9395 return
9496 self .offset += items
95- for buffername , l in self .bufferlist :
97+ for buffername , _ in self .bufferlist :
9698 buf = getattr (self , buffername )
9799 assert abs (items ) <= len (buf ), "Cannot shift further than length of buffer."
98100 fill = zeros ((abs (items ), len (buf [0 ])))
You can’t perform that action at this time.
0 commit comments