提交 1170dbdb authored 作者: Frederic's avatar Frederic

add in doc StripPickler and CompatUnpickler. Add a seealso

上级 2232c5e7
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
.. autofunction:: theano.misc.pkl_utils.load .. autofunction:: theano.misc.pkl_utils.load
.. autoclass:: theano.misc.pkl_utils.StripPickler
.. autoclass:: theano.misc.pkl_utils.CompatUnpickler
.. seealso:: .. seealso::
:ref:`tutorial_loadsave` :ref:`tutorial_loadsave`
......
...@@ -9,8 +9,4 @@ ...@@ -9,8 +9,4 @@
:synopsis: Neighbours Ops :synopsis: Neighbours Ops
.. moduleauthor:: LISA .. moduleauthor:: LISA
API :ref:`Moved <libdoc_tensor_nnet_neighbours>`
===
.. automodule:: theano.sandbox.neighbours
:members:
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:mod:`neighbours` -- Ops for working with images in convolutional nets :mod:`neighbours` -- Ops for working with images in convolutional nets
======================================================================= =======================================================================
.. module:: sandbox.neighbours .. module:: theano.tensor.nnet.neighbours
:platform: Unix, Windows :platform: Unix, Windows
:synopsis: Ops for working with images in conv nets :synopsis: Ops for working with images in conv nets
.. moduleauthor:: LISA .. moduleauthor:: LISA
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:synopsis: ops for performing various forms of downsampling :synopsis: ops for performing various forms of downsampling
.. moduleauthor:: LISA .. moduleauthor:: LISA
.. seealso:: :func:`theano.tensor.nnet.neighbours.images2neibs`
.. autofunction:: theano.tensor.signal.downsample.max_pool_2d .. autofunction:: theano.tensor.signal.downsample.max_pool_2d
.. autofunction:: theano.tensor.signal.downsample.max_pool_2d_same_size .. autofunction:: theano.tensor.signal.downsample.max_pool_2d_same_size
......
...@@ -117,12 +117,38 @@ def load_reduce(self): ...@@ -117,12 +117,38 @@ def load_reduce(self):
if PY3: if PY3:
class CompatUnpickler(pickle._Unpickler): class CompatUnpickler(pickle._Unpickler):
"""
Allow to reload in python 3 some pickled numpy ndarray.
Examples
--------
with open(fname, 'rb') as fp:
if PY3:
u = CompatUnpickler(fp, encoding="latin1")
else:
u = CompatUnpickler(fp)
mat = u.load()
"""
pass pass
# Register `load_reduce` defined above in CompatUnpickler # Register `load_reduce` defined above in CompatUnpickler
CompatUnpickler.dispatch[pickle.REDUCE[0]] = load_reduce CompatUnpickler.dispatch[pickle.REDUCE[0]] = load_reduce
else: else:
class CompatUnpickler(pickle.Unpickler): class CompatUnpickler(pickle.Unpickler):
"""
Allow to reload in python 3 some pickled numpy ndarray.
Examples
--------
with open(fname, 'rb') as fp:
if PY3:
u = CompatUnpickler(fp, encoding="latin1")
else:
u = CompatUnpickler(fp)
mat = u.load()
"""
pass pass
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论