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`.
``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.
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.