提交 09e446f5 authored 作者: Frederic's avatar Frederic

Document theano.shard( broadcastable) parameter.

上级 b4818d54
...@@ -47,21 +47,11 @@ ...@@ -47,21 +47,11 @@
:type: class:`Container` :type: class:`Container`
.. function:: shared(value, name=None, strict=False, **kwargs) .. autofunction:: theano.compile.sharedvalue.shared
Return a :class:`SharedVariable` Variable, initialized with a copy or reference of `value`. .. function:: shared_constructor(ctor)
This function iterates over constructor functions (see `shared_constructor`) to find a
suitable SharedVariable subclass. The suitable one is the first constructor
that doesn't raise an exception.
This function is meant as a convenient default. If you want to use a
specific shared variable constructor, consider calling it directly.
.. note::
By passing `kwargs`, you effectively limit the set of potential constructors to those that Append `ctor` to the list of shared constructors (see :func:`shared`).
can accept those kwargs.
Each registered constructor ``ctor`` will be called like this: Each registered constructor ``ctor`` will be called like this:
...@@ -69,12 +59,4 @@ ...@@ -69,12 +59,4 @@
ctor(value, name=name, strict=strict, **kwargs) ctor(value, name=name, strict=strict, **kwargs)
.. attribute:: constructors If it do not support given value, it must raise a TypeError.
A list of shared variable constructors that will be tried in reverse
order.
.. function:: shared_constructor(ctor)
Append `ctor` to the list of shared constructors (see :func:`shared`).
...@@ -169,15 +169,32 @@ def shared(value, name=None, strict=False, allow_downcast=None, **kwargs): ...@@ -169,15 +169,32 @@ def shared(value, name=None, strict=False, allow_downcast=None, **kwargs):
"""Return a SharedVariable Variable, initialized with a copy or """Return a SharedVariable Variable, initialized with a copy or
reference of `value`. reference of `value`.
This function iterates over constructor functions (see This function iterates over
`shared_constructor`) to find a suitable SharedVariable subclass. :ref:`constructor functions <shared_constructor>`
to find a suitable SharedVariable subclass.
The suitable one is the first constructor that accept the given value.
This function is meant as a convenient default. If you want to use a
specific shared variable constructor, consider calling it directly.
``theano.shared`` is a shortcut to this function.
:note: By passing kwargs, you effectively limit the set of :note: By passing kwargs, you effectively limit the set of
potential constructors to those that can accept those kwargs. potential constructors to those that can accept those kwargs.
:note: Some shared variable have 'borrow' as extra kwargs. :note: Some shared variable have ``borrow`` as extra kwargs.
`See <http://deeplearning.net/software/theano/tutorial/aliasing.html#borrowing-when-creating-shared-variables>`_ for detail. `See <http://deeplearning.net/software/theano/tutorial/aliasing.html#borrowing-when-creating-shared-variables>`_ for detail.
:note: Some shared variable have ``broadcastable`` as extra kwargs.
As shared variable shapes can changes, all dimensions default
to not being broadcastable. This parameter allow you to create
for example a `row` or `column` 2d tensor.
.. attribute:: constructors
A list of shared variable constructors that will be tried in reverse
order.
""" """
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论