@@ -35,12 +35,11 @@ The ``inputs`` argument to ``pytensor.function`` is a list, containing the ``Var
35
35
can be set by ``kwarg ``, and its value can be accessed by
36
36
``self.<name> ``. The default value is ``None ``.
37
37
38
- ``value ``: literal or ``Container ``. The initial/default value for this
38
+ ``value ``: ``Container ``. The initial value for this
39
39
input. If update is ``None ``, this input acts just like
40
40
an argument with a default value in Python. If update is not ``None ``,
41
- changes to this
42
- value will "stick around", whether due to an update or a user's
43
- explicit action.
41
+ changes to this value will "stick around", whether due to an update
42
+ or a user's explicit action.
44
43
45
44
``update ``: Variable instance. This expression Variable will
46
45
replace ``value `` after each function call. The default value is
@@ -73,18 +72,16 @@ The ``inputs`` argument to ``pytensor.function`` is a list, containing the ``Var
73
72
overwriting its content without being aware of it).
74
73
75
74
76
- Value: initial and default values
77
- ---------------------------------
75
+ Update
76
+ ------
78
77
79
- A non-None `value ` argument makes an In() instance an optional parameter
80
- of the compiled function. For example, in the following code we are
81
- defining an arity-2 function ``inc ``.
78
+ We can define an update to modify the value
82
79
83
80
>>> import pytensor.tensor as pt
84
81
>>> from pytensor import function
85
82
>>> from pytensor.compile.io import In
86
83
>>> u, x, s = pt.scalars(' u' , ' x' , ' s' )
87
- >>> inc = function([u, In(x, value = 3 ), In(s, update = (s+ x* u), value = 10.0 )], [])
84
+ >>> inc = function([u, In(x), In(s, update = (s+ x* u)], [])
88
85
89
86
Since we provided a ``value `` for ``s `` and ``x ``, we can call it with just a value for ``u `` like this:
90
87
0 commit comments