提交 8ace004c authored 作者: Mohammad Pezeshki's avatar Mohammad Pezeshki

arguments rewritten

上级 1da748da
...@@ -27,29 +27,12 @@ array(8.0) ...@@ -27,29 +27,12 @@ array(8.0)
The idea here is that we've compiled the symbolic graph (``2*x``) into a function that can be called on a number and will do some computations. The idea here is that we've compiled the symbolic graph (``2*x``) into a function that can be called on a number and will do some computations.
The behaviour of function can be controlled in several ways, such as The behaviour of function can be controlled in several ways, such as
:class:`In`, ``mode``, ``updates``, and ``givens``. These are covered :class:`In`, :class:`Out`, ``mode``, ``updates``, and ``givens``. These are covered
in the :ref:`tutorial examples <basictutexamples>` and :ref:`tutorial on modes <using_modes>`. in the :ref:`tutorial examples <basictutexamples>` and :ref:`tutorial on modes <using_modes>`.
Reference Reference
========= =========
.. class:: Out
A class for attaching information to function outputs
.. attribute:: variable
A variable in an expression graph to use as a compiled-function
output
.. attribute:: borrow
``True`` indicates that a reference to internal storage may be returned, and that the caller is aware that subsequent function evaluations might overwrite this memory.
.. method:: __init__(variable, borrow=False)
Initialize attributes from arguments.
.. class:: In .. class:: In
A class for attaching information to function inputs. A class for attaching information to function inputs.
...@@ -58,29 +41,67 @@ Reference ...@@ -58,29 +41,67 @@ Reference
A variable in an expression graph to use as a compiled-function parameter A variable in an expression graph to use as a compiled-function parameter
.. attribute:: default .. attribute:: name
A string to identify an argument for this parameter in keyword arguments.
.. attribute:: value
The default value to use at call-time (can also be a Container where The default value to use at call-time (can also be a Container where
the function will find a value at call-time.) the function will find a value at call-time.)
.. attribute:: name .. attribute:: update
A string to identify an argument for this parameter in keyword arguments. An expression which indicates updates to the Value after each function call.
.. attribute:: mutable .. attribute:: mutable
``True`` means the compiled-function is allowed to modify this ``True`` means the compiled-function is allowed to modify this
argument. ``False`` means it is not allowed. argument. ``False`` means it is not allowed.
.. attribute:: borrow
``True`` indicates that a reference to internal storage may be returned, and that the caller is aware that subsequent function evaluations might overwrite this memory.
.. attribute:: strict .. attribute:: strict
If ``False``, a function argument may be copied or cast to match the type If ``False``, a function argument may be copied or cast to match the type
required by the parameter `variable`. If ``True``, a function argument required by the parameter `variable`. If ``True``, a function argument
must exactly match the type required by `variable`. must exactly match the type required by `variable`.
.. method:: __init__(self, variable, default=None, name=None, mutable=False, strict=False) .. attribute:: allow_downcast
``True`` indicates that the value you pass for this input can be silently downcasted to fit the right type, which may lose precision. (Only applies when `strict` is ``False``.)
.. attribute:: autoname
``True`` means that the `name` is set to variable.name.
.. attribute:: implicit
``True`` means that the input is implicit in the sense that the user is not allowed to provide a value for it. Requires 'value' to be set.
``False`` means that the user can provide a value for this input.
.. method:: __init__(self, variable, name=None, value=None, update=None, mutable=None, strict=False, allow_downcast=None, autoname=True, implicit=None, borrow=None, shared=False)
Initialize attributes from arguments.
.. class:: Out
A class for attaching information to function outputs
Initialize object attributes. .. attribute:: variable
A variable in an expression graph to use as a compiled-function
output
.. attribute:: borrow
``True`` indicates that a reference to internal storage may be returned, and that the caller is aware that subsequent function evaluations might overwrite this memory.
.. method:: __init__(variable, borrow=False)
Initialize attributes from arguments.
.. function:: function(inputs, outputs, mode=None, updates=None, givens=None, no_default_updates=False, accept_inplace=False, name=None, rebuild_strict=True, allow_input_downcast=None, profile=None, on_unused_input='raise') .. function:: function(inputs, outputs, mode=None, updates=None, givens=None, no_default_updates=False, accept_inplace=False, name=None, rebuild_strict=True, allow_input_downcast=None, profile=None, on_unused_input='raise')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论