diff datasets/dsetiter.py @ 179:defd388aba0c

Do not yield theano shared variables. They can only be used by theano.function().
author Arnaud Bergeron <abergeron@gmail.com>
date Sat, 27 Feb 2010 16:07:09 -0500
parents 938bd350dbf0
children 76bc047df5ee
line wrap: on
line diff
--- a/datasets/dsetiter.py	Sat Feb 27 15:09:02 2010 -0500
+++ b/datasets/dsetiter.py	Sat Feb 27 16:07:09 2010 -0500
@@ -88,11 +88,11 @@
             >>> d._fill_buf()
             >>> d.curpos
             0
-            >>> len(d.buffer.value)
+            >>> len(d.buffer)
             10
             >>> d = DataIterator([DummyFile(11), DummyFile(9)], 10, 10)
             >>> d._fill_buf()
-            >>> len(d.buffer.value)
+            >>> len(d.buffer)
             10
             >>> d._fill_buf()
             Traceback (most recent call last):
@@ -100,7 +100,7 @@
             StopIteration
             >>> d = DataIterator([DummyFile(10), DummyFile(9)], 10, 10)
             >>> d._fill_buf()
-            >>> len(d.buffer.value)
+            >>> len(d.buffer)
             9
             >>> d._fill_buf()
             Traceback (most recent call last):
@@ -123,7 +123,7 @@
             tmpbuf = self.curfile.read(self.bufsize - len(buf))
             buf = numpy.row_stack((buf, tmpbuf))
 
-        self.buffer = theano.shared(numpy.asarray(buf, dtype=theano.config.floatX))
+        self.buffer = numpy.asarray(buf, dtype=theano.config.floatX)
         self.curpos = 0
 
     def __next__(self):
@@ -132,10 +132,10 @@
 
         Test:
             >>> d = DataIterator([DummyFile(20)], 10, 20)
-            >>> d.next()
-            Subtensor{0:10:}.0
-            >>> d.next()
-            Subtensor{10:20:}.0
+            >>> len(d.next())
+            10
+            >>> len(d.next())
+            10
             >>> d.next()
             Traceback (most recent call last):
               ...