Skip to content

Commit 4c1f269

Browse files
committed
Remove deprecated PyTensor function functionality and reduce overhead
1 parent 4d96c47 commit 4c1f269

File tree

10 files changed

+475
-875
lines changed

10 files changed

+475
-875
lines changed

doc/library/compile/io.rst

+7-10
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ The ``inputs`` argument to ``pytensor.function`` is a list, containing the ``Var
3535
can be set by ``kwarg``, and its value can be accessed by
3636
``self.<name>``. The default value is ``None``.
3737

38-
``value``: literal or ``Container``. The initial/default value for this
38+
``value``: ``Container``. The initial value for this
3939
input. If update is ``None``, this input acts just like
4040
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.
4443

4544
``update``: Variable instance. This expression Variable will
4645
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
7372
overwriting its content without being aware of it).
7473

7574

76-
Value: initial and default values
77-
---------------------------------
75+
Update
76+
------
7877

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
8279

8380
>>> import pytensor.tensor as pt
8481
>>> from pytensor import function
8582
>>> from pytensor.compile.io import In
8683
>>> 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)], [])
8885

8986
Since we provided a ``value`` for ``s`` and ``x``, we can call it with just a value for ``u`` like this:
9087

0 commit comments

Comments
 (0)