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

add in doc StripPickler and CompatUnpickler. Add a seealso

上级 2232c5e7
......@@ -13,6 +13,10 @@
.. autofunction:: theano.misc.pkl_utils.load
.. autoclass:: theano.misc.pkl_utils.StripPickler
.. autoclass:: theano.misc.pkl_utils.CompatUnpickler
.. seealso::
:ref:`tutorial_loadsave`
......
......@@ -9,8 +9,4 @@
:synopsis: Neighbours Ops
.. moduleauthor:: LISA
API
===
.. automodule:: theano.sandbox.neighbours
:members:
:ref:`Moved <libdoc_tensor_nnet_neighbours>`
......@@ -4,7 +4,7 @@
:mod:`neighbours` -- Ops for working with images in convolutional nets
=======================================================================
.. module:: sandbox.neighbours
.. module:: theano.tensor.nnet.neighbours
:platform: Unix, Windows
:synopsis: Ops for working with images in conv nets
.. moduleauthor:: LISA
......
......@@ -9,6 +9,7 @@
:synopsis: ops for performing various forms of downsampling
.. 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_same_size
......
......@@ -117,12 +117,38 @@ def load_reduce(self):
if PY3:
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
# Register `load_reduce` defined above in CompatUnpickler
CompatUnpickler.dispatch[pickle.REDUCE[0]] = load_reduce
else:
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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论