pytensor 2.26.3__tar.gz → 2.26.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytensor-2.26.3/pytensor.egg-info → pytensor-2.26.4}/PKG-INFO +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/random/index.rst +1 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/examples.rst +3 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/prng.rst +3 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pyproject.toml +5 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/_version.py +3 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/builders.py +22 -11
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/debugmode.py +9 -7
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/function/pfunc.py +3 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/function/types.py +95 -83
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/formatting.py +2 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/gradient.py +16 -19
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/basic.py +9 -9
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/op.py +2 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/replace.py +3 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/rewriting/basic.py +25 -15
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/ifelse.py +12 -6
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/basic.py +25 -50
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/basic.py +18 -9
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/cmodule.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/op.py +2 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/params_type.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/scan.py +10 -5
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/shape.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/tensor_basic.py +2 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/linker.py +5 -9
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/__init__.py +5 -4
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/basic.py +3 -2
- pytensor-2.26.4/pytensor/link/numba/dispatch/blockwise.py +92 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/cython_support.py +7 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/elemwise.py +99 -221
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/extra_ops.py +2 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/random.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/scalar.py +3 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/scan.py +4 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/slinalg.py +2 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/subtensor.py +150 -8
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/tensor_basic.py +6 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/vectorize_codegen.py +22 -13
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/linker.py +0 -17
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/basic.py +5 -6
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/blockwise.py +3 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/elemwise.py +31 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/scalar.py +15 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/shape.py +2 -1
- pytensor-2.26.4/pytensor/link/pytorch/linker.py +92 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/utils.py +14 -5
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/vm.py +7 -5
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/check_blas.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/printing.py +6 -7
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/basic.py +15 -35
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/loop.py +7 -6
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/basic.py +5 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/op.py +44 -21
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/rewriting.py +31 -22
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/utils.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/basic.py +2 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/basic.py +13 -10
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/blockwise.py +73 -21
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/conv/abstract_conv.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/einsum.py +7 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/elemwise.py +50 -26
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/elemwise_cgen.py +16 -11
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/extra_ops.py +5 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/functional.py +4 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/math.py +1 -76
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/nlinalg.py +30 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/pad.py +3 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/basic.py +2 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/op.py +9 -5
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/rewriting/basic.py +4 -4
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/rewriting/numba.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/utils.py +18 -8
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/__init__.py +1 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/basic.py +19 -20
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/blas.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/blockwise.py +6 -3
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/elemwise.py +8 -6
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/linalg.py +72 -48
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/math.py +6 -2
- pytensor-2.26.4/pytensor/tensor/rewriting/numba.py +108 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/ofg.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/shape.py +9 -7
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/subtensor.py +33 -12
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/shape.py +10 -4
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/slinalg.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/subtensor.py +35 -13
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/type.py +7 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/utils.py +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/variable.py +3 -1
- {pytensor-2.26.3 → pytensor-2.26.4/pytensor.egg-info}/PKG-INFO +1 -1
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor.egg-info/SOURCES.txt +2 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_gradient.py +11 -6
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_ifelse.py +2 -2
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_printing.py +2 -2
- pytensor-2.26.3/pytensor/link/pytorch/linker.py +0 -36
- {pytensor-2.26.3 → pytensor-2.26.4}/LICENSE.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/MANIFEST.in +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/README.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/.templates/PLACEHOLDER +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/.templates/layout.html +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/LICENSE.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/README.md +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/acknowledgement.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/bcast.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/bcast.svg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/conf.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/core_development_guide.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/css.inc +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/dev_start_guide.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/environment.yml +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/apply.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/apply.svg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/apply2.svg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/creating_a_c_op.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/creating_a_numba_jax_op.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/creating_an_op.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/ctype.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/extending_faq.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/extending_pytensor_solution_1.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/graph_rewriting.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/graphstructures.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/inplace.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/op.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/other_ops.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/pics/symbolic_graph_opt.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/pics/symbolic_graph_unopt.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/pipeline.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/scan.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/tips.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/type.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/unittest.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/extending/using_params.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/faq.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/generate_dtype_tensor_table.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/glossary.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/Elman_srnn.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/PyTensor_RGB.svg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/blocksparse.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/lstm.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/lstm_memorycell.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/talk2010.gif +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/images/talk2010.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/install.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/internal/how_to_release.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/internal/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/internal/metadocumentation.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/introduction.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/debugmode.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/function.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/io.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/mode.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/nanguardmode.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/opfromgraph.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/ops.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/profilemode.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/compile/shared.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/config.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/css/d3-context-menu.css +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/css/d3viz.css +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/js/d3-context-menu.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/js/d3.v3.min.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/js/d3viz.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/js/dagre-d3.min.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/d3viz/js/graphlib-dot.min.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/mlp.html +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/mlp.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/mlp2.html +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/mlp2.pdf +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/mlp2.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/ofg.html +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/examples/ofg2.html +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/index.ipynb +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/index_files/index_10_0.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/index_files/index_11_0.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/index_files/index_24_0.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/d3viz/index_files/index_25_0.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/gradient.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/features.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/fgraph.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/graph.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/op.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/replace.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/type.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/graph/utils.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/misc/pkl_utils.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/printing.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/sandbox/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/sandbox/linalg.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/scalar/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/scan.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/sparse/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/sparse/sandbox.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/basic.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/basic_opt.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/bcast.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/bcast.svg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/conv.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/elemwise.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/extra_ops.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/fft.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/functional.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/io.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/math_opt.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/nlinalg.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/plot_fft.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/random/distributions.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/slinalg.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/tensor/utils.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/library/typed_list.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/links.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/optimizations.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/pylintrc +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/troubleshooting.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/adding.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/adding_solution_1.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/aliasing.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/apply.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/apply.svg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/bcast.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/broadcasting.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/conditions.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/debug_faq.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/dlogistic.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/faq_tutorial.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/gradients.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/index.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/loading_and_saving.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/logistic.gp +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/logistic.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/loop.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/loop_solution_1.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/modes.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/modes_solution_1.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/multi_cores.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/nan_tutorial.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/pics/d3viz.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/pics/logreg_pydotprint_predict.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/pics/logreg_pydotprint_prediction.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/pics/logreg_pydotprint_train.png +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/printing_drawing.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/profiling.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/profiling_example.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/profiling_example_out.prof +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/shape_info.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/sparse.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/tutorial/symbolic_graphs.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/doc/user_guide.rst +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/bin/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/bin/pytensor_cache.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/breakpoint.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/compiledir.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/compilelock.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/function/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/io.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/mode.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/monitormode.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/nanguardmode.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/ops.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/profiling.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/compile/sharedvalue.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/configdefaults.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/configparser.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/css/d3-context-menu.css +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/css/d3viz.css +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/d3viz.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/js/d3-context-menu.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/js/d3.v3.min.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/js/d3viz.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/js/dagre-d3.min.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/d3viz/js/graphlib-dot.min.js +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/destroyhandler.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/features.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/fg.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/null_type.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/rewriting/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/rewriting/db.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/rewriting/kanren.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/rewriting/unify.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/rewriting/utils.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/type.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/graph/utils.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/c_code/lazylinker_c.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/c_code/pytensor_mod_helper.h +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/cutils.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/cvm.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/exceptions.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/interface.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/lazylinker_c.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/c/type.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/basic.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/blas.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/blockwise.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/einsum.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/elemwise.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/extra_ops.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/math.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/nlinalg.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/pad.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/random.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/scalar.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/slinalg.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/sort.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/sparse.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/jax/dispatch/subtensor.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/nlinalg.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/numba/dispatch/sparse.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/blas.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/extra_ops.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/math.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/nlinalg.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/sort.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/link/pytorch/dispatch/subtensor.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/check_blas_many.sh +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/check_duplicate_key.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/elemwise_openmp_speedup.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/elemwise_time_test.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/frozendict.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/may_share_memory.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/ordered_set.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/misc/pkl_utils.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/py.typed +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/raise_op.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/c_code/Faddeeva.cc +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/c_code/Faddeeva.hh +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/c_code/gamma.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/c_code/incbet.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/math.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scalar/sharedvar.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/checkpoints.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/scan_perform.pyx +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/scan_perform_ext.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/scan/views.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/rewriting.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/sandbox/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/sandbox/sp.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/sandbox/sp2.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/sharedvar.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/type.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/sparse/utils.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/blas.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/blas_c.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/blas_headers.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/blas_scipy.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/c_code/alt_blas_common.h +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/c_code/alt_blas_template.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/c_code/dimshuffle.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/conv/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/exceptions.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/fft.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/fourier.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/inplace.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/io.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/linalg.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/rewriting/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/rewriting/jax.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/type.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/random/var.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/blas_c.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/blas_scipy.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/einsum.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/extra_ops.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/jax.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/special.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/rewriting/uncanonicalize.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/sharedvar.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/sort.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/special.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/type_other.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/var.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/tensor/xlogx.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/typed_list/__init__.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/typed_list/basic.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/typed_list/rewriting.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/typed_list/type.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/updates.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor/utils.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor.egg-info/dependency_links.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor.egg-info/entry_points.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor.egg-info/requires.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/pytensor.egg-info/top_level.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/scripts/mypy-failing.txt +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/setup.cfg +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/setup.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/link/c/c_code/test_cenum.h +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/link/c/c_code/test_quadratic_function.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/tensor/conv/c_code/corr3d_gemm.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/tensor/conv/c_code/corr_gemm.c +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_breakpoint.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_config.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_raise_op.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_rop.py +0 -0
- {pytensor-2.26.3 → pytensor-2.26.4}/tests/test_updates.py +0 -0
|
@@ -30,6 +30,7 @@ sophisticated `Op`\s like `Scan`, which makes it a user-friendly random variable
|
|
|
30
30
|
interface in PyTensor.
|
|
31
31
|
|
|
32
32
|
For an example of how to use random numbers, see :ref:`Using Random Numbers <using_random_numbers>`.
|
|
33
|
+
For a technical explanation of how PyTensor implements random variables see :ref:`prng`.
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
.. class:: RandomStream()
|
|
@@ -357,6 +357,9 @@ hold here as well. PyTensor's random objects are defined and implemented in
|
|
|
357
357
|
:ref:`RandomStream<libdoc_tensor_random_utils>` and, at a lower level,
|
|
358
358
|
in :ref:`RandomVariable<libdoc_tensor_random_basic>`.
|
|
359
359
|
|
|
360
|
+
For a more technical explanation of how PyTensor implements random variables see :ref:`prng`.
|
|
361
|
+
|
|
362
|
+
|
|
360
363
|
Brief Example
|
|
361
364
|
-------------
|
|
362
365
|
|
|
@@ -5,7 +5,9 @@ Pseudo random number generation in PyTensor
|
|
|
5
5
|
===========================================
|
|
6
6
|
|
|
7
7
|
PyTensor has native support for `pseudo random number generation (PRNG) <https://en.wikipedia.org/wiki/Pseudorandom_number_generator>`_.
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
This document describes the details of how PRNGs are implemented in PyTensor, via the RandomVariable Operator.
|
|
10
|
+
For a more applied example see :ref:`using_random_numbers`
|
|
9
11
|
|
|
10
12
|
We also discuss how initial seeding and seeding updates are implemented, and some harder cases such as using RandomVariables inside Scan, or with other backends like JAX.
|
|
11
13
|
|
|
@@ -129,8 +129,12 @@ exclude = ["doc/", "pytensor/_version.py"]
|
|
|
129
129
|
docstring-code-format = true
|
|
130
130
|
|
|
131
131
|
[tool.ruff.lint]
|
|
132
|
-
select = ["C", "E", "F", "I", "UP", "W", "RUF", "PERF", "PTH", "ISC"]
|
|
132
|
+
select = ["B905", "C", "E", "F", "I", "UP", "W", "RUF", "PERF", "PTH", "ISC"]
|
|
133
133
|
ignore = ["C408", "C901", "E501", "E741", "RUF012", "PERF203", "ISC001"]
|
|
134
|
+
unfixable = [
|
|
135
|
+
# zip-strict: the auto-fix adds `strict=False` but we might want `strict=True` instead
|
|
136
|
+
"B905",
|
|
137
|
+
]
|
|
134
138
|
|
|
135
139
|
|
|
136
140
|
[tool.ruff.lint.isort]
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2024-
|
|
11
|
+
"date": "2024-12-03T16:01:13+0100",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2.26.
|
|
14
|
+
"full-revisionid": "07bd48dbc93225a66c4decfd2d50162f4322e67f",
|
|
15
|
+
"version": "2.26.4"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -43,7 +43,7 @@ def infer_shape(outs, inputs, input_shapes):
|
|
|
43
43
|
# TODO: ShapeFeature should live elsewhere
|
|
44
44
|
from pytensor.tensor.rewriting.shape import ShapeFeature
|
|
45
45
|
|
|
46
|
-
for inp, inp_shp in zip(inputs, input_shapes):
|
|
46
|
+
for inp, inp_shp in zip(inputs, input_shapes, strict=True):
|
|
47
47
|
if inp_shp is not None and len(inp_shp) != inp.type.ndim:
|
|
48
48
|
assert len(inp_shp) == inp.type.ndim
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ def infer_shape(outs, inputs, input_shapes):
|
|
|
51
51
|
shape_feature.on_attach(FunctionGraph([], []))
|
|
52
52
|
|
|
53
53
|
# Initialize shape_of with the input shapes
|
|
54
|
-
for inp, inp_shp in zip(inputs, input_shapes):
|
|
54
|
+
for inp, inp_shp in zip(inputs, input_shapes, strict=True):
|
|
55
55
|
shape_feature.set_shape(inp, inp_shp)
|
|
56
56
|
|
|
57
57
|
def local_traverse(out):
|
|
@@ -108,7 +108,9 @@ def construct_nominal_fgraph(
|
|
|
108
108
|
|
|
109
109
|
replacements = dict(
|
|
110
110
|
zip(
|
|
111
|
-
inputs + implicit_shared_inputs,
|
|
111
|
+
inputs + implicit_shared_inputs,
|
|
112
|
+
dummy_inputs + dummy_implicit_shared_inputs,
|
|
113
|
+
strict=True,
|
|
112
114
|
)
|
|
113
115
|
)
|
|
114
116
|
|
|
@@ -138,7 +140,7 @@ def construct_nominal_fgraph(
|
|
|
138
140
|
NominalVariable(n, var.type) for n, var in enumerate(local_inputs)
|
|
139
141
|
)
|
|
140
142
|
|
|
141
|
-
fgraph.replace_all(zip(local_inputs, nominal_local_inputs))
|
|
143
|
+
fgraph.replace_all(zip(local_inputs, nominal_local_inputs, strict=True))
|
|
142
144
|
|
|
143
145
|
for i, inp in enumerate(fgraph.inputs):
|
|
144
146
|
nom_inp = nominal_local_inputs[i]
|
|
@@ -562,7 +564,9 @@ class OpFromGraph(Op, HasInnerGraph):
|
|
|
562
564
|
# compute non-overriding downsteam grads from upstreams grads
|
|
563
565
|
# it's normal some input may be disconnected, thus the 'ignore'
|
|
564
566
|
wrt = [
|
|
565
|
-
lin
|
|
567
|
+
lin
|
|
568
|
+
for lin, gov in zip(inner_inputs, custom_input_grads, strict=True)
|
|
569
|
+
if gov is None
|
|
566
570
|
]
|
|
567
571
|
default_input_grads = fn_grad(wrt=wrt) if wrt else []
|
|
568
572
|
input_grads = self._combine_list_overrides(
|
|
@@ -653,7 +657,7 @@ class OpFromGraph(Op, HasInnerGraph):
|
|
|
653
657
|
f = [
|
|
654
658
|
output
|
|
655
659
|
for output, custom_output_grad in zip(
|
|
656
|
-
inner_outputs, custom_output_grads
|
|
660
|
+
inner_outputs, custom_output_grads, strict=True
|
|
657
661
|
)
|
|
658
662
|
if custom_output_grad is None
|
|
659
663
|
]
|
|
@@ -733,18 +737,24 @@ class OpFromGraph(Op, HasInnerGraph):
|
|
|
733
737
|
|
|
734
738
|
non_shared_inputs = [
|
|
735
739
|
inp_t.filter_variable(inp)
|
|
736
|
-
for inp, inp_t in zip(non_shared_inputs, self.input_types)
|
|
740
|
+
for inp, inp_t in zip(non_shared_inputs, self.input_types, strict=True)
|
|
737
741
|
]
|
|
738
742
|
|
|
739
743
|
new_shared_inputs = inputs[num_expected_inps:]
|
|
740
|
-
inner_and_input_shareds = list(
|
|
744
|
+
inner_and_input_shareds = list(
|
|
745
|
+
zip(self.shared_inputs, new_shared_inputs, strict=True)
|
|
746
|
+
)
|
|
741
747
|
|
|
742
748
|
if not all(inp_s == inn_s for inn_s, inp_s in inner_and_input_shareds):
|
|
743
749
|
# The shared variables are not equal to the original shared
|
|
744
750
|
# variables, so we construct a new `Op` that uses the new shared
|
|
745
751
|
# variables instead.
|
|
746
752
|
replace = dict(
|
|
747
|
-
zip(
|
|
753
|
+
zip(
|
|
754
|
+
self.inner_inputs[num_expected_inps:],
|
|
755
|
+
new_shared_inputs,
|
|
756
|
+
strict=True,
|
|
757
|
+
)
|
|
748
758
|
)
|
|
749
759
|
|
|
750
760
|
# If the new shared variables are inconsistent with the inner-graph,
|
|
@@ -811,7 +821,7 @@ class OpFromGraph(Op, HasInnerGraph):
|
|
|
811
821
|
# each shape call. PyTensor optimizer will clean this up later, but this
|
|
812
822
|
# will make extra work for the optimizer.
|
|
813
823
|
|
|
814
|
-
repl = dict(zip(self.inner_inputs, node.inputs))
|
|
824
|
+
repl = dict(zip(self.inner_inputs, node.inputs, strict=True))
|
|
815
825
|
clone_out_shapes = [s for s in out_shapes if isinstance(s, tuple)]
|
|
816
826
|
cloned = clone_replace(sum(clone_out_shapes, ()), replace=repl)
|
|
817
827
|
ret = []
|
|
@@ -853,5 +863,6 @@ class OpFromGraph(Op, HasInnerGraph):
|
|
|
853
863
|
def perform(self, node, inputs, outputs):
|
|
854
864
|
variables = self.fn(*inputs)
|
|
855
865
|
assert len(variables) == len(outputs)
|
|
856
|
-
|
|
866
|
+
# strict=False because asserted above
|
|
867
|
+
for output, variable in zip(outputs, variables, strict=False):
|
|
857
868
|
output[0] = variable
|
|
@@ -865,7 +865,7 @@ def _get_preallocated_maps(
|
|
|
865
865
|
# except if broadcastable, or for dimensions above
|
|
866
866
|
# config.DebugMode__check_preallocated_output_ndim
|
|
867
867
|
buf_shape = []
|
|
868
|
-
for s, b in zip(r_vals[r].shape, r.broadcastable):
|
|
868
|
+
for s, b in zip(r_vals[r].shape, r.broadcastable, strict=True):
|
|
869
869
|
if b or ((r.ndim - len(buf_shape)) > check_ndim):
|
|
870
870
|
buf_shape.append(s)
|
|
871
871
|
else:
|
|
@@ -943,7 +943,7 @@ def _get_preallocated_maps(
|
|
|
943
943
|
r_shape_diff = shape_diff[: r.ndim]
|
|
944
944
|
new_buf_shape = [
|
|
945
945
|
max((s + sd), 0)
|
|
946
|
-
for s, sd in zip(r_vals[r].shape, r_shape_diff)
|
|
946
|
+
for s, sd in zip(r_vals[r].shape, r_shape_diff, strict=True)
|
|
947
947
|
]
|
|
948
948
|
new_buf = np.empty(new_buf_shape, dtype=r.type.dtype)
|
|
949
949
|
new_buf[...] = np.asarray(def_val).astype(r.type.dtype)
|
|
@@ -1575,7 +1575,7 @@ class _Linker(LocalLinker):
|
|
|
1575
1575
|
# try:
|
|
1576
1576
|
# compute the value of all variables
|
|
1577
1577
|
for i, (thunk_py, thunk_c, node) in enumerate(
|
|
1578
|
-
zip(thunks_py, thunks_c, order)
|
|
1578
|
+
zip(thunks_py, thunks_c, order, strict=True)
|
|
1579
1579
|
):
|
|
1580
1580
|
_logger.debug(f"{i} - starting node {i} {node}")
|
|
1581
1581
|
|
|
@@ -1855,7 +1855,7 @@ class _Linker(LocalLinker):
|
|
|
1855
1855
|
assert s[0] is None
|
|
1856
1856
|
|
|
1857
1857
|
# store our output variables to their respective storage lists
|
|
1858
|
-
for output, storage in zip(fgraph.outputs, output_storage):
|
|
1858
|
+
for output, storage in zip(fgraph.outputs, output_storage, strict=True):
|
|
1859
1859
|
storage[0] = r_vals[output]
|
|
1860
1860
|
|
|
1861
1861
|
# transfer all inputs back to their respective storage lists
|
|
@@ -1931,11 +1931,11 @@ class _Linker(LocalLinker):
|
|
|
1931
1931
|
f,
|
|
1932
1932
|
[
|
|
1933
1933
|
Container(input, storage, readonly=False)
|
|
1934
|
-
for input, storage in zip(fgraph.inputs, input_storage)
|
|
1934
|
+
for input, storage in zip(fgraph.inputs, input_storage, strict=True)
|
|
1935
1935
|
],
|
|
1936
1936
|
[
|
|
1937
1937
|
Container(output, storage, readonly=True)
|
|
1938
|
-
for output, storage in zip(fgraph.outputs, output_storage)
|
|
1938
|
+
for output, storage in zip(fgraph.outputs, output_storage, strict=True)
|
|
1939
1939
|
],
|
|
1940
1940
|
thunks_py,
|
|
1941
1941
|
order,
|
|
@@ -2122,7 +2122,9 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
|
|
|
2122
2122
|
|
|
2123
2123
|
no_borrow = [
|
|
2124
2124
|
output
|
|
2125
|
-
for output, spec in zip(
|
|
2125
|
+
for output, spec in zip(
|
|
2126
|
+
fgraph.outputs, outputs + additional_outputs, strict=True
|
|
2127
|
+
)
|
|
2126
2128
|
if not spec.borrow
|
|
2127
2129
|
]
|
|
2128
2130
|
if no_borrow:
|
|
@@ -603,7 +603,7 @@ def construct_pfunc_ins_and_outs(
|
|
|
603
603
|
|
|
604
604
|
new_inputs = []
|
|
605
605
|
|
|
606
|
-
for i, iv in zip(inputs, input_variables):
|
|
606
|
+
for i, iv in zip(inputs, input_variables, strict=True):
|
|
607
607
|
new_i = copy(i)
|
|
608
608
|
new_i.variable = iv
|
|
609
609
|
|
|
@@ -637,13 +637,13 @@ def construct_pfunc_ins_and_outs(
|
|
|
637
637
|
assert len(fgraph.inputs) == len(inputs)
|
|
638
638
|
assert len(fgraph.outputs) == len(outputs)
|
|
639
639
|
|
|
640
|
-
for fg_inp, inp in zip(fgraph.inputs, inputs):
|
|
640
|
+
for fg_inp, inp in zip(fgraph.inputs, inputs, strict=True):
|
|
641
641
|
if fg_inp != getattr(inp, "variable", inp):
|
|
642
642
|
raise ValueError(
|
|
643
643
|
f"`fgraph`'s input does not match the provided input: {fg_inp}, {inp}"
|
|
644
644
|
)
|
|
645
645
|
|
|
646
|
-
for fg_out, out in zip(fgraph.outputs, outputs):
|
|
646
|
+
for fg_out, out in zip(fgraph.outputs, outputs, strict=True):
|
|
647
647
|
if fg_out != getattr(out, "variable", out):
|
|
648
648
|
raise ValueError(
|
|
649
649
|
f"`fgraph`'s output does not match the provided output: {fg_out}, {out}"
|
|
@@ -241,7 +241,7 @@ def std_fgraph(
|
|
|
241
241
|
fgraph.attach_feature(
|
|
242
242
|
Supervisor(
|
|
243
243
|
input
|
|
244
|
-
for spec, input in zip(input_specs, fgraph.inputs)
|
|
244
|
+
for spec, input in zip(input_specs, fgraph.inputs, strict=True)
|
|
245
245
|
if not (
|
|
246
246
|
spec.mutable
|
|
247
247
|
or (hasattr(fgraph, "destroyers") and fgraph.has_destroyers([input]))
|
|
@@ -393,6 +393,8 @@ class Function:
|
|
|
393
393
|
assert len(self.input_storage) == len(self.maker.fgraph.inputs)
|
|
394
394
|
assert len(self.output_storage) == len(self.maker.fgraph.outputs)
|
|
395
395
|
|
|
396
|
+
self.has_defaults = any(refeed for _, refeed, _ in self.defaults)
|
|
397
|
+
|
|
396
398
|
# Group indexes of inputs that are potentially aliased to each other
|
|
397
399
|
# Note: Historically, we only worried about aliasing inputs if they belonged to the same type,
|
|
398
400
|
# even though there could be two distinct types that use the same kinds of underlying objects.
|
|
@@ -442,7 +444,7 @@ class Function:
|
|
|
442
444
|
# this loop works by modifying the elements (as variable c) of
|
|
443
445
|
# self.input_storage inplace.
|
|
444
446
|
for i, ((input, indices, sinputs), (required, refeed, value)) in enumerate(
|
|
445
|
-
zip(self.indices, defaults)
|
|
447
|
+
zip(self.indices, defaults, strict=True)
|
|
446
448
|
):
|
|
447
449
|
if indices is None:
|
|
448
450
|
# containers is being used as a stack. Here we pop off
|
|
@@ -540,14 +542,40 @@ class Function:
|
|
|
540
542
|
self._value = ValueAttribute()
|
|
541
543
|
self._container = ContainerAttribute()
|
|
542
544
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
+
update_storage = [
|
|
546
|
+
container
|
|
547
|
+
for inp, container in zip(
|
|
548
|
+
self.maker.expanded_inputs, input_storage, strict=True
|
|
549
|
+
)
|
|
550
|
+
if inp.update is not None
|
|
551
|
+
]
|
|
552
|
+
# Updates are the last inner outputs that are not returned by Function.__call__
|
|
553
|
+
self.n_returned_outputs = len(self.output_storage) - len(update_storage)
|
|
554
|
+
|
|
555
|
+
# Function.__call__ is responsible for updating the inputs, unless the vm promises to do it itself
|
|
556
|
+
self.update_input_storage: tuple[int, Container] = ()
|
|
557
|
+
if getattr(vm, "need_update_inputs", True):
|
|
558
|
+
self.update_input_storage = tuple(
|
|
559
|
+
zip(
|
|
560
|
+
range(self.n_returned_outputs, len(output_storage)),
|
|
561
|
+
update_storage,
|
|
562
|
+
strict=True,
|
|
563
|
+
)
|
|
564
|
+
)
|
|
545
565
|
|
|
546
|
-
#
|
|
547
|
-
# we
|
|
548
|
-
#
|
|
549
|
-
self.
|
|
550
|
-
|
|
566
|
+
# In every function call we place inputs in the input_storage, and the vm places outputs in the output_storage
|
|
567
|
+
# After the call, we want to erase (some of) these references, to allow Python to GC them if unused
|
|
568
|
+
# Required input containers are the non-default inputs, must always be provided again, so we GC them
|
|
569
|
+
self.clear_input_storage_data = tuple(
|
|
570
|
+
container.storage for container in input_storage if container.required
|
|
571
|
+
)
|
|
572
|
+
# This is only done when `vm.allow_gc` is True, which can change at runtime.
|
|
573
|
+
self.clear_output_storage_data = tuple(
|
|
574
|
+
container.storage
|
|
575
|
+
for container, variable in zip(
|
|
576
|
+
self.output_storage, self.maker.fgraph.outputs, strict=True
|
|
577
|
+
)
|
|
578
|
+
if variable.owner is not None # Not a constant output
|
|
551
579
|
)
|
|
552
580
|
|
|
553
581
|
for node in self.maker.fgraph.apply_nodes:
|
|
@@ -671,7 +699,7 @@ class Function:
|
|
|
671
699
|
else:
|
|
672
700
|
outs = list(map(SymbolicOutput, fg_cpy.outputs))
|
|
673
701
|
|
|
674
|
-
for out_ori, out_cpy in zip(maker.outputs, outs):
|
|
702
|
+
for out_ori, out_cpy in zip(maker.outputs, outs, strict=False):
|
|
675
703
|
out_cpy.borrow = out_ori.borrow
|
|
676
704
|
|
|
677
705
|
# swap SharedVariable
|
|
@@ -684,7 +712,7 @@ class Function:
|
|
|
684
712
|
raise ValueError(f"SharedVariable: {sv.name} not found")
|
|
685
713
|
|
|
686
714
|
# Swap SharedVariable in fgraph and In instances
|
|
687
|
-
for index, (i, in_v) in enumerate(zip(ins, fg_cpy.inputs)):
|
|
715
|
+
for index, (i, in_v) in enumerate(zip(ins, fg_cpy.inputs, strict=True)):
|
|
688
716
|
# Variables in maker.inputs are defined by user, therefore we
|
|
689
717
|
# use them to make comparison and do the mapping.
|
|
690
718
|
# Otherwise we don't touch them.
|
|
@@ -708,7 +736,7 @@ class Function:
|
|
|
708
736
|
|
|
709
737
|
# Delete update if needed
|
|
710
738
|
rev_update_mapping = {v: k for k, v in fg_cpy.update_mapping.items()}
|
|
711
|
-
for n, (inp, in_var) in enumerate(zip(ins, fg_cpy.inputs)):
|
|
739
|
+
for n, (inp, in_var) in enumerate(zip(ins, fg_cpy.inputs, strict=True)):
|
|
712
740
|
inp.variable = in_var
|
|
713
741
|
if not delete_updates and inp.update is not None:
|
|
714
742
|
out_idx = rev_update_mapping[n]
|
|
@@ -747,7 +775,7 @@ class Function:
|
|
|
747
775
|
elif isinstance(profile, str):
|
|
748
776
|
profile = pytensor.compile.profiling.ProfileStats(message=profile)
|
|
749
777
|
|
|
750
|
-
f_cpy = maker
|
|
778
|
+
f_cpy = type(maker)(
|
|
751
779
|
inputs=ins,
|
|
752
780
|
outputs=outs,
|
|
753
781
|
fgraph=fg_cpy,
|
|
@@ -765,10 +793,16 @@ class Function:
|
|
|
765
793
|
# check that.
|
|
766
794
|
accept_inplace=True,
|
|
767
795
|
no_fgraph_prep=True,
|
|
796
|
+
output_keys=maker.output_keys,
|
|
797
|
+
name=name,
|
|
768
798
|
).create(input_storage, storage_map=new_storage_map)
|
|
769
799
|
|
|
770
800
|
for in_ori, in_cpy, ori, cpy in zip(
|
|
771
|
-
maker.inputs,
|
|
801
|
+
maker.inputs,
|
|
802
|
+
f_cpy.maker.inputs,
|
|
803
|
+
self.input_storage,
|
|
804
|
+
f_cpy.input_storage,
|
|
805
|
+
strict=True,
|
|
772
806
|
):
|
|
773
807
|
# Share immutable ShareVariable and constant input's storage
|
|
774
808
|
swapped = swap is not None and in_ori.variable in swap
|
|
@@ -793,8 +827,6 @@ class Function:
|
|
|
793
827
|
|
|
794
828
|
f_cpy.trust_input = self.trust_input
|
|
795
829
|
f_cpy.unpack_single = self.unpack_single
|
|
796
|
-
f_cpy.name = name
|
|
797
|
-
f_cpy.maker.fgraph.name = name
|
|
798
830
|
return f_cpy
|
|
799
831
|
|
|
800
832
|
def _restore_defaults(self):
|
|
@@ -804,7 +836,7 @@ class Function:
|
|
|
804
836
|
value = value.storage[0]
|
|
805
837
|
self[i] = value
|
|
806
838
|
|
|
807
|
-
def __call__(self, *args, **kwargs):
|
|
839
|
+
def __call__(self, *args, output_subset=None, **kwargs):
|
|
808
840
|
"""
|
|
809
841
|
Evaluates value of a function on given arguments.
|
|
810
842
|
|
|
@@ -832,20 +864,21 @@ class Function:
|
|
|
832
864
|
List of outputs on indices/keys from ``output_subset`` or all of them,
|
|
833
865
|
if ``output_subset`` is not passed.
|
|
834
866
|
"""
|
|
867
|
+
trust_input = self.trust_input
|
|
835
868
|
input_storage = self.input_storage
|
|
869
|
+
vm = self.vm
|
|
836
870
|
profile = self.profile
|
|
837
871
|
|
|
838
872
|
if profile:
|
|
839
873
|
t0 = time.perf_counter()
|
|
840
874
|
|
|
841
|
-
output_subset = kwargs.pop("output_subset", None)
|
|
842
875
|
if output_subset is not None:
|
|
843
876
|
warnings.warn("output_subset is deprecated.", FutureWarning)
|
|
844
877
|
if self.output_keys is not None:
|
|
845
878
|
output_subset = [self.output_keys.index(key) for key in output_subset]
|
|
846
879
|
|
|
847
880
|
# Reinitialize each container's 'provided' counter
|
|
848
|
-
if
|
|
881
|
+
if trust_input:
|
|
849
882
|
for arg_container, arg in zip(input_storage, args, strict=False):
|
|
850
883
|
arg_container.storage[0] = arg
|
|
851
884
|
else:
|
|
@@ -904,7 +937,7 @@ class Function:
|
|
|
904
937
|
for k, arg in kwargs.items():
|
|
905
938
|
self[k] = arg
|
|
906
939
|
|
|
907
|
-
if not
|
|
940
|
+
if not trust_input:
|
|
908
941
|
# Collect aliased inputs among the storage space
|
|
909
942
|
for potential_group in self._potential_aliased_input_groups:
|
|
910
943
|
args_share_memory: list[list[int]] = []
|
|
@@ -956,11 +989,7 @@ class Function:
|
|
|
956
989
|
if profile:
|
|
957
990
|
t0_fn = time.perf_counter()
|
|
958
991
|
try:
|
|
959
|
-
outputs = (
|
|
960
|
-
self.vm()
|
|
961
|
-
if output_subset is None
|
|
962
|
-
else self.vm(output_subset=output_subset)
|
|
963
|
-
)
|
|
992
|
+
outputs = vm() if output_subset is None else vm(output_subset=output_subset)
|
|
964
993
|
except Exception:
|
|
965
994
|
self._restore_defaults()
|
|
966
995
|
if hasattr(self.vm, "position_of_error"):
|
|
@@ -987,37 +1016,23 @@ class Function:
|
|
|
987
1016
|
|
|
988
1017
|
# Retrieve the values that were computed
|
|
989
1018
|
if outputs is None:
|
|
990
|
-
outputs = [x.
|
|
991
|
-
|
|
992
|
-
#
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
if getattr(
|
|
1001
|
-
for
|
|
1002
|
-
|
|
1003
|
-
):
|
|
1004
|
-
if o_variable.owner is not None:
|
|
1005
|
-
# this node is the variable of computation
|
|
1006
|
-
# WARNING: This circumvents the 'readonly' attribute in x
|
|
1007
|
-
o_container.storage[0] = None
|
|
1008
|
-
|
|
1009
|
-
if getattr(self.vm, "need_update_inputs", True):
|
|
1010
|
-
# Update the inputs that have an update function
|
|
1011
|
-
for input, storage in reversed(
|
|
1012
|
-
list(zip(self.maker.expanded_inputs, input_storage))
|
|
1013
|
-
):
|
|
1014
|
-
if input.update is not None:
|
|
1015
|
-
storage.data = outputs.pop()
|
|
1016
|
-
else:
|
|
1017
|
-
outputs = outputs[: self.n_returned_outputs]
|
|
1019
|
+
outputs = [x.storage[0] for x in self.output_storage]
|
|
1020
|
+
|
|
1021
|
+
# Set updates and filter them out from the returned outputs
|
|
1022
|
+
for i, input_storage in self.update_input_storage:
|
|
1023
|
+
input_storage.storage[0] = outputs[i]
|
|
1024
|
+
outputs = outputs[: self.n_returned_outputs]
|
|
1025
|
+
|
|
1026
|
+
# Remove input and output values from storage data
|
|
1027
|
+
for storage_data in self.clear_input_storage_data:
|
|
1028
|
+
storage_data[0] = None
|
|
1029
|
+
if getattr(vm, "allow_gc", False):
|
|
1030
|
+
for storage_data in self.clear_output_storage_data:
|
|
1031
|
+
storage_data[0] = None
|
|
1018
1032
|
|
|
1019
1033
|
# Put default values back in the storage
|
|
1020
|
-
self.
|
|
1034
|
+
if self.has_defaults:
|
|
1035
|
+
self._restore_defaults()
|
|
1021
1036
|
|
|
1022
1037
|
if profile:
|
|
1023
1038
|
dt_call = time.perf_counter() - t0
|
|
@@ -1025,32 +1040,29 @@ class Function:
|
|
|
1025
1040
|
self.maker.mode.call_time += dt_call
|
|
1026
1041
|
profile.fct_callcount += 1
|
|
1027
1042
|
profile.fct_call_time += dt_call
|
|
1028
|
-
if hasattr(
|
|
1029
|
-
|
|
1043
|
+
if hasattr(vm, "update_profile"):
|
|
1044
|
+
vm.update_profile(profile)
|
|
1030
1045
|
if profile.ignore_first_call:
|
|
1031
1046
|
profile.reset()
|
|
1032
1047
|
profile.ignore_first_call = False
|
|
1033
1048
|
|
|
1034
1049
|
if self.return_none:
|
|
1035
1050
|
return None
|
|
1036
|
-
elif self.unpack_single and len(outputs) == 1 and output_subset is None:
|
|
1037
|
-
return outputs[0]
|
|
1038
|
-
else:
|
|
1039
|
-
if self.output_keys is not None:
|
|
1040
|
-
assert len(self.output_keys) == len(outputs)
|
|
1041
1051
|
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
else:
|
|
1045
|
-
return {
|
|
1046
|
-
self.output_keys[index]: outputs[index]
|
|
1047
|
-
for index in output_subset
|
|
1048
|
-
}
|
|
1052
|
+
if output_subset is not None:
|
|
1053
|
+
outputs = [outputs[i] for i in output_subset]
|
|
1049
1054
|
|
|
1050
|
-
|
|
1051
|
-
|
|
1055
|
+
if self.output_keys is None:
|
|
1056
|
+
if self.unpack_single:
|
|
1057
|
+
[out] = outputs
|
|
1058
|
+
return out
|
|
1052
1059
|
else:
|
|
1053
|
-
return
|
|
1060
|
+
return outputs
|
|
1061
|
+
else:
|
|
1062
|
+
output_keys = self.output_keys
|
|
1063
|
+
if output_subset is not None:
|
|
1064
|
+
output_keys = [output_keys[i] for i in output_subset]
|
|
1065
|
+
return dict(zip(output_keys, outputs, strict=True))
|
|
1054
1066
|
|
|
1055
1067
|
value = property(
|
|
1056
1068
|
lambda self: self._value,
|
|
@@ -1070,9 +1082,10 @@ class Function:
|
|
|
1070
1082
|
# 1.no allow_gc return False
|
|
1071
1083
|
# 2.has allow_gc, if allow_gc is False, return True
|
|
1072
1084
|
if not getattr(self.vm, "allow_gc", True):
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1085
|
+
storage_map = self.vm.storage_map
|
|
1086
|
+
for key, value in storage_map.items():
|
|
1087
|
+
if key.owner is not None: # Not a constant
|
|
1088
|
+
value[0] = None
|
|
1076
1089
|
|
|
1077
1090
|
for node in self.nodes_with_inner_function:
|
|
1078
1091
|
if hasattr(node.fn, "free"):
|
|
@@ -1084,10 +1097,6 @@ class Function:
|
|
|
1084
1097
|
"""
|
|
1085
1098
|
return [i.variable for i in self.maker.inputs if i.implicit]
|
|
1086
1099
|
|
|
1087
|
-
def sync_shared(self):
|
|
1088
|
-
# NOTE: sync was needed on old gpu backend
|
|
1089
|
-
pass
|
|
1090
|
-
|
|
1091
1100
|
def dprint(self, **kwargs):
|
|
1092
1101
|
"""Debug print itself
|
|
1093
1102
|
|
|
@@ -1107,8 +1116,9 @@ def _pickle_Function(f):
|
|
|
1107
1116
|
ins = list(f.input_storage)
|
|
1108
1117
|
input_storage = []
|
|
1109
1118
|
|
|
1119
|
+
# strict=False because we are in a hot loop
|
|
1110
1120
|
for (input, indices, inputs), (required, refeed, default) in zip(
|
|
1111
|
-
f.indices, f.defaults
|
|
1121
|
+
f.indices, f.defaults, strict=False
|
|
1112
1122
|
):
|
|
1113
1123
|
input_storage.append(ins[0])
|
|
1114
1124
|
del ins[0]
|
|
@@ -1150,7 +1160,7 @@ def _constructor_Function(maker, input_storage, inputs_data, trust_input=False):
|
|
|
1150
1160
|
|
|
1151
1161
|
f = maker.create(input_storage)
|
|
1152
1162
|
assert len(f.input_storage) == len(inputs_data)
|
|
1153
|
-
for container, x in zip(f.input_storage, inputs_data):
|
|
1163
|
+
for container, x in zip(f.input_storage, inputs_data, strict=True):
|
|
1154
1164
|
assert (
|
|
1155
1165
|
(container.data is x)
|
|
1156
1166
|
or (isinstance(x, np.ndarray) and (container.data == x).all())
|
|
@@ -1184,7 +1194,7 @@ def insert_deepcopy(fgraph, wrapped_inputs, wrapped_outputs):
|
|
|
1184
1194
|
reason = "insert_deepcopy"
|
|
1185
1195
|
updated_fgraph_inputs = {
|
|
1186
1196
|
fgraph_i
|
|
1187
|
-
for i, fgraph_i in zip(wrapped_inputs, fgraph.inputs)
|
|
1197
|
+
for i, fgraph_i in zip(wrapped_inputs, fgraph.inputs, strict=True)
|
|
1188
1198
|
if getattr(i, "update", False)
|
|
1189
1199
|
}
|
|
1190
1200
|
|
|
@@ -1521,7 +1531,9 @@ class FunctionMaker:
|
|
|
1521
1531
|
# return the internal storage pointer.
|
|
1522
1532
|
no_borrow = [
|
|
1523
1533
|
output
|
|
1524
|
-
for output, spec in zip(
|
|
1534
|
+
for output, spec in zip(
|
|
1535
|
+
fgraph.outputs, outputs + found_updates, strict=True
|
|
1536
|
+
)
|
|
1525
1537
|
if not spec.borrow
|
|
1526
1538
|
]
|
|
1527
1539
|
|
|
@@ -1590,7 +1602,7 @@ class FunctionMaker:
|
|
|
1590
1602
|
# defaults lists.
|
|
1591
1603
|
assert len(self.indices) == len(input_storage)
|
|
1592
1604
|
for i, ((input, indices, subinputs), input_storage_i) in enumerate(
|
|
1593
|
-
zip(self.indices, input_storage)
|
|
1605
|
+
zip(self.indices, input_storage, strict=True)
|
|
1594
1606
|
):
|
|
1595
1607
|
# Replace any default value given as a variable by its
|
|
1596
1608
|
# container. Note that this makes sense only in the
|
|
@@ -244,14 +244,14 @@ class PyDotFormatter:
|
|
|
244
244
|
ext_inputs = [self.__node_id(x) for x in node.inputs]
|
|
245
245
|
int_inputs = [gf.__node_id(x) for x in node.op.inner_inputs]
|
|
246
246
|
assert len(ext_inputs) == len(int_inputs)
|
|
247
|
-
h = format_map(zip(ext_inputs, int_inputs))
|
|
247
|
+
h = format_map(zip(ext_inputs, int_inputs, strict=True))
|
|
248
248
|
pd_node.get_attributes()["subg_map_inputs"] = h
|
|
249
249
|
|
|
250
250
|
# Outputs mapping
|
|
251
251
|
ext_outputs = [self.__node_id(x) for x in node.outputs]
|
|
252
252
|
int_outputs = [gf.__node_id(x) for x in node.op.inner_outputs]
|
|
253
253
|
assert len(ext_outputs) == len(int_outputs)
|
|
254
|
-
h = format_map(zip(int_outputs, ext_outputs))
|
|
254
|
+
h = format_map(zip(int_outputs, ext_outputs, strict=True))
|
|
255
255
|
pd_node.get_attributes()["subg_map_outputs"] = h
|
|
256
256
|
|
|
257
257
|
return graph
|