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

Document theano.shard( broadcastable) parameter.

上级 b4818d54
......@@ -47,21 +47,11 @@
: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`.
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::
.. function:: shared_constructor(ctor)
By passing `kwargs`, you effectively limit the set of potential constructors to those that
can accept those kwargs.
Append `ctor` to the list of shared constructors (see :func:`shared`).
Each registered constructor ``ctor`` will be called like this:
......@@ -69,12 +59,4 @@
ctor(value, name=name, strict=strict, **kwargs)
.. attribute:: constructors
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`).
If it do not support given value, it must raise a TypeError.
......@@ -169,15 +169,32 @@ def shared(value, name=None, strict=False, allow_downcast=None, **kwargs):
"""Return a SharedVariable Variable, initialized with a copy or
reference of `value`.
This function iterates over constructor functions (see
`shared_constructor`) to find a suitable SharedVariable subclass.
This function iterates over
: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
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.
: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:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论