pytensor 2.10.0__tar.gz → 2.11.0__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.10.0 → pytensor-2.11.0}/PKG-INFO +2 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/graph_rewriting.rst +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/sparse/index.rst +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/basic.rst +2 -2
- {pytensor-2.10.0 → pytensor-2.11.0}/pyproject.toml +1 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/__init__.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/_version.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/profiling.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/gradient.py +2 -2
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/basic.py +16 -0
- pytensor-2.11.0/pytensor/link/jax/dispatch/scan.py +193 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/tensor_basic.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/basic.py +11 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/elemwise.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/sparse.py +66 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/linker.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/safe_asarray.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/basic.py +7 -4
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/basic.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/op.py +1 -2
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/rewriting.py +154 -33
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/basic.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/basic.py +37 -16
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/blas.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/conv/abstract_conv.py +13 -6
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/elemwise.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/exceptions.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/extra_ops.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/inplace.py +1 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/math.py +12 -1
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/basic.py +22 -22
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/op.py +2 -2
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/basic.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/elemwise.py +12 -2
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/math.py +26 -20
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/shape.py +3 -3
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/subtensor.py +28 -10
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/shape.py +6 -6
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/sharedvar.py +3 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/subtensor.py +10 -10
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/var.py +2 -2
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor.egg-info/PKG-INFO +2 -1
- pytensor-2.10.0/pytensor/link/jax/dispatch/scan.py +0 -159
- {pytensor-2.10.0 → pytensor-2.11.0}/LICENSE.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/MANIFEST.in +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/README.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/bin/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/bin/downstream_pr.sh +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/bin/pytensor-cache +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/bin/pytensor_cache.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/bin/upstream_pr.sh +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/.templates/PLACEHOLDER +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/.templates/layout.html +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/LICENSE.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/README.md +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/acknowledgement.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/bcast.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/bcast.svg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/conf.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/core_development_guide.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/css.inc +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/dev_start_guide.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/environment.yml +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/apply.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/apply.svg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/apply2.svg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/creating_a_c_op.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/creating_a_numba_jax_op.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/creating_an_op.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/ctype.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/extending_faq.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/extending_pytensor_solution_1.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/graphstructures.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/inplace.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/op.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/other_ops.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/pics/symbolic_graph_opt.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/pics/symbolic_graph_unopt.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/pipeline.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/scan.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/tips.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/type.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/unittest.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/extending/using_params.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/faq.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/generate_dtype_tensor_table.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/glossary.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/Elman_srnn.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/PyTensor_RGB.svg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/blocksparse.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/lstm.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/lstm_memorycell.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/talk2010.gif +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/images/talk2010.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/install.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/internal/how_to_release.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/internal/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/internal/metadocumentation.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/introduction.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/debugmode.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/function.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/io.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/mode.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/nanguardmode.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/opfromgraph.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/ops.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/profilemode.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/compile/shared.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/config.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/css/d3-context-menu.css +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/css/d3viz.css +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/js/d3-context-menu.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/js/d3.v3.min.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/js/d3viz.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/js/dagre-d3.min.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/d3viz/js/graphlib-dot.min.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/mlp.html +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/mlp.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/mlp2.html +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/mlp2.pdf +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/mlp2.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/ofg.html +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/examples/ofg2.html +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/index.ipynb +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/index_files/index_10_0.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/index_files/index_11_0.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/index_files/index_24_0.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/d3viz/index_files/index_25_0.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/gradient.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/features.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/fgraph.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/graph.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/op.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/type.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/graph/utils.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/misc/pkl_utils.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/printing.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/sandbox/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/sandbox/linalg.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/scalar/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/scan.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/sparse/sandbox.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/basic_opt.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/bcast.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/bcast.svg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/conv.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/elemwise.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/extra_ops.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/fft.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/io.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/math_opt.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/nlinalg.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/plot_fft.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/random/basic.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/random/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/random/utils.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/slinalg.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/tensor/utils.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/library/typed_list.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/links.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/optimizations.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/pylintrc +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/ccodegen.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/compilation.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/debugging_with_stepmode.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/elemwise_compiler.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/function.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/functional.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/how_to_make_ops.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/index2.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/interactive_debugger.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/logistic_regression_example.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/performance.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/randomnumbers.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/rethinkccodegen.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/sandbox.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/software.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/sparse.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/sandbox/tensoroptools.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/scripts/docgen.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/troubleshooting.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/adding.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/adding_solution_1.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/aliasing.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/apply.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/apply.svg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/bcast.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/broadcasting.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/conditions.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/debug_faq.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/dlogistic.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/examples.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/faq_tutorial.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/gradients.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/index.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/loading_and_saving.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/logistic.gp +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/logistic.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/loop.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/loop_solution_1.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/modes.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/modes_solution_1.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/multi_cores.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/nan_tutorial.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/pics/d3viz.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/pics/logreg_pydotprint_predict.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/pics/logreg_pydotprint_prediction.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/pics/logreg_pydotprint_train.png +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/printing_drawing.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/profiling.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/profiling_example.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/profiling_example_out.prof +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/shape_info.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/sparse.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/tutorial/symbolic_graphs.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/doc/user_guide.rst +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/breakpoint.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/builders.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/compiledir.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/compilelock.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/debugmode.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/function/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/function/pfunc.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/function/types.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/io.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/mode.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/monitormode.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/nanguardmode.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/ops.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/compile/sharedvalue.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/configdefaults.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/configparser.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/css/d3-context-menu.css +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/css/d3viz.css +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/d3viz.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/formatting.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/js/d3-context-menu.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/js/d3.v3.min.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/js/d3viz.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/js/dagre-d3.min.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/d3viz/js/graphlib-dot.min.js +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/destroyhandler.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/features.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/fg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/null_type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/op.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/replace.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/rewriting/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/rewriting/basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/rewriting/db.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/rewriting/kanren.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/rewriting/unify.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/rewriting/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/graph/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/ifelse.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/c_code/lazylinker_c.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/c_code/pytensor_mod_helper.h +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/cmodule.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/cutils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/cvm.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/exceptions.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/interface.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/lazylinker_c.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/op.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/params_type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/c/type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/elemwise.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/extra_ops.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/nlinalg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/random.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/scalar.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/shape.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/slinalg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/dispatch/subtensor.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/jax/linker.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/cython_support.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/elemwise_codegen.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/extra_ops.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/nlinalg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/random.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/scalar.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/scan.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/numba/dispatch/tensor_basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/link/vm.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/check_blas.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/check_blas_many.sh +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/check_duplicate_key.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/elemwise_openmp_speedup.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/elemwise_time_test.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/frozendict.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/may_share_memory.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/ordered_set.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/misc/pkl_utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/printing.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/py.typed +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/raise_op.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sandbox/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sandbox/linalg/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sandbox/linalg/ops.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sandbox/minimal.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/c_code/Faddeeva.cc +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/c_code/Faddeeva.hh +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/c_code/gamma.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/math.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scalar/sharedvar.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/checkpoints.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/scan_perform.pyx +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/scan_perform_ext.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/scan/views.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/rewriting.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/sandbox/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/sandbox/sp.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/sandbox/sp2.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/sharedvar.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/sparse/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/blas_c.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/blas_headers.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/blas_scipy.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/c_code/alt_blas_common.h +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/c_code/alt_blas_template.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/c_code/dimshuffle.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/conv/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/elemwise_cgen.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/fft.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/fourier.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/io.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/linalg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/nlinalg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/rewriting/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/rewriting/basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/rewriting/jax.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/random/var.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/extra_ops.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/jax.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/special.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/rewriting/uncanonicalize.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/slinalg.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/sort.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/special.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/type_other.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/tensor/xlogx.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/typed_list/__init__.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/typed_list/basic.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/typed_list/rewriting.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/typed_list/type.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/updates.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/utils.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor/version.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor.egg-info/SOURCES.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor.egg-info/dependency_links.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor.egg-info/entry_points.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor.egg-info/requires.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/pytensor.egg-info/top_level.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/scripts/mypy-failing.txt +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/scripts/run_mypy.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/setup.cfg +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/setup.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/link/c/c_code/test_cenum.h +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/link/c/c_code/test_quadratic_function.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/tensor/conv/c_code/corr3d_gemm.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/tensor/conv/c_code/corr_gemm.c +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_breakpoint.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_config.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_gradient.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_ifelse.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_printing.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_raise_op.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_rop.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/tests/test_updates.py +0 -0
- {pytensor-2.10.0 → pytensor-2.11.0}/versioneer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pytensor
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.11.0
|
|
4
4
|
Summary: Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs.
|
|
5
5
|
Author-email: pymc-devs <pymc.devs@gmail.com>
|
|
6
6
|
License: .. _license:
|
|
@@ -69,6 +69,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
69
69
|
Classifier: Programming Language :: Python :: 3.8
|
|
70
70
|
Classifier: Programming Language :: Python :: 3.9
|
|
71
71
|
Classifier: Programming Language :: Python :: 3.10
|
|
72
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
72
73
|
Requires-Python: >=3.8
|
|
73
74
|
Description-Content-Type: text/x-rst
|
|
74
75
|
Provides-Extra: complete
|
|
@@ -603,7 +603,7 @@ An :class:`EquilibriumDB` contains :class:`NodeRewriter` or :class:`RewriteDatab
|
|
|
603
603
|
has a name and an arbitrary number of tags. When a :class:`RewriteDatabaseQuery` is applied to
|
|
604
604
|
an :class:`EquilibriumDB`, all :class:`NodeRewriter`\s that match the query are
|
|
605
605
|
inserted into an :class:`EquilibriumGraphRewriter`, which is returned. If the
|
|
606
|
-
:class:`
|
|
606
|
+
:class:`EquilibriumDB` contains :class:`RewriteDatabase` instances, the
|
|
607
607
|
:class:`RewriteDatabaseQuery` will be passed to them as well and the
|
|
608
608
|
:class:`NodeRewriter`\s they return will be put in their places
|
|
609
609
|
(note that as of yet no :class:`RewriteDatabase` can produce :class:`NodeRewriter` objects, so this
|
|
@@ -577,7 +577,7 @@ them perfectly, but a `dscalar` otherwise.
|
|
|
577
577
|
.. method:: round(mode="half_away_from_zero")
|
|
578
578
|
:noindex:
|
|
579
579
|
.. method:: trace()
|
|
580
|
-
.. method::
|
|
580
|
+
.. method:: get_underlying_scalar_constant_value()
|
|
581
581
|
.. method:: zeros_like(model, dtype=None)
|
|
582
582
|
|
|
583
583
|
All the above methods are equivalent to NumPy for PyTensor on the current tensor.
|
|
@@ -1462,7 +1462,7 @@ Mathematical
|
|
|
1462
1462
|
|
|
1463
1463
|
Returns a variable representing the base e, 2 or 10 logarithm of a.
|
|
1464
1464
|
|
|
1465
|
-
.. function::
|
|
1465
|
+
.. function:: sign(a)
|
|
1466
1466
|
|
|
1467
1467
|
Returns a variable representing the sign of a.
|
|
1468
1468
|
|
|
@@ -137,7 +137,7 @@ from pytensor.updates import OrderedUpdates
|
|
|
137
137
|
# isort: on
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
def
|
|
140
|
+
def get_underlying_scalar_constant(v):
|
|
141
141
|
"""Return the constant scalar (i.e. 0-D) value underlying variable `v`.
|
|
142
142
|
|
|
143
143
|
If `v` is the output of dim-shuffles, fills, allocs, cast, etc.
|
|
@@ -153,8 +153,8 @@ def get_scalar_constant_value(v):
|
|
|
153
153
|
if sparse and isinstance(v.type, sparse.SparseTensorType):
|
|
154
154
|
if v.owner is not None and isinstance(v.owner.op, sparse.CSM):
|
|
155
155
|
data = v.owner.inputs[0]
|
|
156
|
-
return tensor.
|
|
157
|
-
return tensor.
|
|
156
|
+
return tensor.get_underlying_scalar_constant_value(data)
|
|
157
|
+
return tensor.get_underlying_scalar_constant_value(v)
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
# isort: off
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2023-
|
|
11
|
+
"date": "2023-04-07T14:56:57+0200",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2.
|
|
14
|
+
"full-revisionid": "98de246293855def134b86b5af6599e74a44835b",
|
|
15
|
+
"version": "2.11.0"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -1325,7 +1325,7 @@ def _populate_grad_dict(var_to_app_to_idx, grad_dict, wrt, cost_name=None):
|
|
|
1325
1325
|
f" {i}. Since this input is only connected "
|
|
1326
1326
|
"to integer-valued outputs, it should "
|
|
1327
1327
|
"evaluate to zeros, but it evaluates to"
|
|
1328
|
-
f"{pytensor.
|
|
1328
|
+
f"{pytensor.get_underlying_scalar_constant(term)}."
|
|
1329
1329
|
)
|
|
1330
1330
|
raise ValueError(msg)
|
|
1331
1331
|
|
|
@@ -2086,7 +2086,7 @@ def _is_zero(x):
|
|
|
2086
2086
|
|
|
2087
2087
|
no_constant_value = True
|
|
2088
2088
|
try:
|
|
2089
|
-
constant_value = pytensor.
|
|
2089
|
+
constant_value = pytensor.get_underlying_scalar_constant(x)
|
|
2090
2090
|
no_constant_value = False
|
|
2091
2091
|
except pytensor.tensor.exceptions.NotScalarConstantError:
|
|
2092
2092
|
pass
|
|
@@ -597,6 +597,22 @@ class Variable(Node, Generic[_TypeType, OptionalApplyType]):
|
|
|
597
597
|
if inputs_to_values is None:
|
|
598
598
|
inputs_to_values = {}
|
|
599
599
|
|
|
600
|
+
def convert_string_keys_to_variables(input_to_values):
|
|
601
|
+
new_input_to_values = {}
|
|
602
|
+
for key, value in inputs_to_values.items():
|
|
603
|
+
if isinstance(key, str):
|
|
604
|
+
matching_vars = get_var_by_name([self], key)
|
|
605
|
+
if not matching_vars:
|
|
606
|
+
raise Exception(f"{key} not found in graph")
|
|
607
|
+
elif len(matching_vars) > 1:
|
|
608
|
+
raise Exception(f"Found multiple variables with name {key}")
|
|
609
|
+
new_input_to_values[matching_vars[0]] = value
|
|
610
|
+
else:
|
|
611
|
+
new_input_to_values[key] = value
|
|
612
|
+
return new_input_to_values
|
|
613
|
+
|
|
614
|
+
inputs_to_values = convert_string_keys_to_variables(inputs_to_values)
|
|
615
|
+
|
|
600
616
|
if not hasattr(self, "_fn_cache"):
|
|
601
617
|
self._fn_cache = dict()
|
|
602
618
|
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import jax
|
|
2
|
+
import jax.numpy as jnp
|
|
3
|
+
|
|
4
|
+
from pytensor.link.jax.dispatch.basic import jax_funcify
|
|
5
|
+
from pytensor.scan.op import Scan
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@jax_funcify.register(Scan)
|
|
9
|
+
def jax_funcify_Scan(op: Scan, **kwargs):
|
|
10
|
+
info = op.info
|
|
11
|
+
|
|
12
|
+
if info.as_while:
|
|
13
|
+
raise NotImplementedError("While Scan cannot yet be converted to JAX")
|
|
14
|
+
|
|
15
|
+
if info.n_mit_mot:
|
|
16
|
+
raise NotImplementedError(
|
|
17
|
+
"Scan with MIT-MOT (gradients of scan) cannot yet be converted to JAX"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
# Optimize inner graph
|
|
21
|
+
rewriter = op.mode_instance.optimizer
|
|
22
|
+
rewriter(op.fgraph)
|
|
23
|
+
scan_inner_func = jax_funcify(op.fgraph, **kwargs)
|
|
24
|
+
|
|
25
|
+
def scan(*outer_inputs):
|
|
26
|
+
# Extract JAX scan inputs
|
|
27
|
+
outer_inputs = list(outer_inputs)
|
|
28
|
+
n_steps = outer_inputs[0] # JAX `length`
|
|
29
|
+
seqs = op.outer_seqs(outer_inputs) # JAX `xs`
|
|
30
|
+
|
|
31
|
+
mit_sot_init = []
|
|
32
|
+
for tap, seq in zip(op.info.mit_sot_in_slices, op.outer_mitsot(outer_inputs)):
|
|
33
|
+
init_slice = seq[: abs(min(tap))]
|
|
34
|
+
mit_sot_init.append(init_slice)
|
|
35
|
+
|
|
36
|
+
sit_sot_init = [seq[0] for seq in op.outer_sitsot(outer_inputs)]
|
|
37
|
+
|
|
38
|
+
init_carry = (
|
|
39
|
+
mit_sot_init,
|
|
40
|
+
sit_sot_init,
|
|
41
|
+
op.outer_shared(outer_inputs),
|
|
42
|
+
op.outer_non_seqs(outer_inputs),
|
|
43
|
+
) # JAX `init`
|
|
44
|
+
|
|
45
|
+
def jax_args_to_inner_func_args(carry, x):
|
|
46
|
+
"""Convert JAX scan arguments into format expected by scan_inner_func.
|
|
47
|
+
|
|
48
|
+
scan(carry, x) -> scan_inner_func(seqs, mit_sot, sit_sot, shared, non_seqs)
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
# `carry` contains all inner taps, shared terms, and non_seqs
|
|
52
|
+
(
|
|
53
|
+
inner_mit_sot,
|
|
54
|
+
inner_sit_sot,
|
|
55
|
+
inner_shared,
|
|
56
|
+
inner_non_seqs,
|
|
57
|
+
) = carry
|
|
58
|
+
|
|
59
|
+
# `x` contains the inner sequences
|
|
60
|
+
inner_seqs = x
|
|
61
|
+
|
|
62
|
+
mit_sot_flatten = []
|
|
63
|
+
for array, index in zip(inner_mit_sot, op.info.mit_sot_in_slices):
|
|
64
|
+
mit_sot_flatten.extend(array[jnp.array(index)])
|
|
65
|
+
|
|
66
|
+
inner_scan_inputs = [
|
|
67
|
+
*inner_seqs,
|
|
68
|
+
*mit_sot_flatten,
|
|
69
|
+
*inner_sit_sot,
|
|
70
|
+
*inner_shared,
|
|
71
|
+
*inner_non_seqs,
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
return inner_scan_inputs
|
|
75
|
+
|
|
76
|
+
def inner_func_outs_to_jax_outs(
|
|
77
|
+
old_carry,
|
|
78
|
+
inner_scan_outs,
|
|
79
|
+
):
|
|
80
|
+
"""Convert inner_scan_func outputs into format expected by JAX scan.
|
|
81
|
+
|
|
82
|
+
old_carry + (mit_sot_outs, sit_sot_outs, nit_sot_outs, shared_outs) -> (new_carry, ys)
|
|
83
|
+
"""
|
|
84
|
+
(
|
|
85
|
+
inner_mit_sot,
|
|
86
|
+
inner_sit_sot,
|
|
87
|
+
inner_shared,
|
|
88
|
+
inner_non_seqs,
|
|
89
|
+
) = old_carry
|
|
90
|
+
|
|
91
|
+
inner_mit_sot_outs = op.inner_mitsot_outs(inner_scan_outs)
|
|
92
|
+
inner_sit_sot_outs = op.inner_sitsot_outs(inner_scan_outs)
|
|
93
|
+
inner_nit_sot_outs = op.inner_nitsot_outs(inner_scan_outs)
|
|
94
|
+
inner_shared_outs = op.inner_shared_outs(inner_scan_outs)
|
|
95
|
+
|
|
96
|
+
# Replace the oldest mit_sot tap by the newest value
|
|
97
|
+
inner_mit_sot_new = [
|
|
98
|
+
jnp.concatenate([old_mit_sot[1:], new_val[None, ...]], axis=0)
|
|
99
|
+
for old_mit_sot, new_val in zip(
|
|
100
|
+
inner_mit_sot,
|
|
101
|
+
inner_mit_sot_outs,
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
# Nothing needs to be done with sit_sot
|
|
106
|
+
inner_sit_sot_new = inner_sit_sot_outs
|
|
107
|
+
|
|
108
|
+
inner_shared_new = inner_shared
|
|
109
|
+
# Replace old shared inputs by new shared outputs
|
|
110
|
+
inner_shared_new[: len(inner_shared_outs)] = inner_shared_outs
|
|
111
|
+
|
|
112
|
+
new_carry = (
|
|
113
|
+
inner_mit_sot_new,
|
|
114
|
+
inner_sit_sot_new,
|
|
115
|
+
inner_shared_new,
|
|
116
|
+
inner_non_seqs,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
# Shared variables and non_seqs are not traced
|
|
120
|
+
traced_outs = [
|
|
121
|
+
*inner_mit_sot_outs,
|
|
122
|
+
*inner_sit_sot_outs,
|
|
123
|
+
*inner_nit_sot_outs,
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
return new_carry, traced_outs
|
|
127
|
+
|
|
128
|
+
def jax_inner_func(carry, x):
|
|
129
|
+
inner_args = jax_args_to_inner_func_args(carry, x)
|
|
130
|
+
inner_scan_outs = list(scan_inner_func(*inner_args))
|
|
131
|
+
new_carry, traced_outs = inner_func_outs_to_jax_outs(carry, inner_scan_outs)
|
|
132
|
+
return new_carry, traced_outs
|
|
133
|
+
|
|
134
|
+
# Extract PyTensor scan outputs
|
|
135
|
+
final_carry, traces = jax.lax.scan(
|
|
136
|
+
jax_inner_func, init_carry, seqs, length=n_steps
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def get_partial_traces(traces):
|
|
140
|
+
"""Convert JAX scan traces to PyTensor traces.
|
|
141
|
+
|
|
142
|
+
We need to:
|
|
143
|
+
1. Prepend initial states to JAX output traces
|
|
144
|
+
2. Slice final traces if Scan was instructed to only keep a portion
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
init_states = mit_sot_init + sit_sot_init + [None] * op.info.n_nit_sot
|
|
148
|
+
buffers = (
|
|
149
|
+
op.outer_mitsot(outer_inputs)
|
|
150
|
+
+ op.outer_sitsot(outer_inputs)
|
|
151
|
+
+ op.outer_nitsot(outer_inputs)
|
|
152
|
+
)
|
|
153
|
+
partial_traces = []
|
|
154
|
+
for init_state, trace, buffer in zip(init_states, traces, buffers):
|
|
155
|
+
if init_state is not None:
|
|
156
|
+
# MIT-SOT and SIT-SOT: The final output should be as long as the input buffer
|
|
157
|
+
full_trace = jnp.concatenate(
|
|
158
|
+
[jnp.atleast_1d(init_state), jnp.atleast_1d(trace)],
|
|
159
|
+
axis=0,
|
|
160
|
+
)
|
|
161
|
+
buffer_size = buffer.shape[0]
|
|
162
|
+
else:
|
|
163
|
+
# NIT-SOT: Buffer is just the number of entries that should be returned
|
|
164
|
+
full_trace = jnp.atleast_1d(trace)
|
|
165
|
+
buffer_size = buffer
|
|
166
|
+
|
|
167
|
+
partial_trace = full_trace[-buffer_size:]
|
|
168
|
+
partial_traces.append(partial_trace)
|
|
169
|
+
|
|
170
|
+
return partial_traces
|
|
171
|
+
|
|
172
|
+
def get_shared_outs(final_carry):
|
|
173
|
+
"""Retrive last state of shared_outs from final_carry.
|
|
174
|
+
|
|
175
|
+
These outputs cannot be traced in PyTensor Scan
|
|
176
|
+
"""
|
|
177
|
+
(
|
|
178
|
+
inner_out_mit_sot,
|
|
179
|
+
inner_out_sit_sot,
|
|
180
|
+
inner_out_shared,
|
|
181
|
+
inner_in_non_seqs,
|
|
182
|
+
) = final_carry
|
|
183
|
+
|
|
184
|
+
shared_outs = inner_out_shared[: info.n_shared_outs]
|
|
185
|
+
return list(shared_outs)
|
|
186
|
+
|
|
187
|
+
scan_outs_final = get_partial_traces(traces) + get_shared_outs(final_carry)
|
|
188
|
+
|
|
189
|
+
if len(scan_outs_final) == 1:
|
|
190
|
+
scan_outs_final = scan_outs_final[0]
|
|
191
|
+
return scan_outs_final
|
|
192
|
+
|
|
193
|
+
return scan
|
|
@@ -18,7 +18,7 @@ from pytensor.tensor.basic import (
|
|
|
18
18
|
ScalarFromTensor,
|
|
19
19
|
Split,
|
|
20
20
|
TensorFromScalar,
|
|
21
|
-
|
|
21
|
+
get_underlying_scalar_constant_value,
|
|
22
22
|
)
|
|
23
23
|
from pytensor.tensor.exceptions import NotScalarConstantError
|
|
24
24
|
|
|
@@ -106,7 +106,7 @@ def jax_funcify_Join(op, **kwargs):
|
|
|
106
106
|
def jax_funcify_Split(op: Split, node, **kwargs):
|
|
107
107
|
_, axis, splits = node.inputs
|
|
108
108
|
try:
|
|
109
|
-
constant_axis =
|
|
109
|
+
constant_axis = get_underlying_scalar_constant_value(axis)
|
|
110
110
|
except NotScalarConstantError:
|
|
111
111
|
constant_axis = None
|
|
112
112
|
warnings.warn(
|
|
@@ -116,7 +116,7 @@ def jax_funcify_Split(op: Split, node, **kwargs):
|
|
|
116
116
|
try:
|
|
117
117
|
constant_splits = np.array(
|
|
118
118
|
[
|
|
119
|
-
|
|
119
|
+
get_underlying_scalar_constant_value(splits[i])
|
|
120
120
|
for i in range(get_vector_length(splits))
|
|
121
121
|
]
|
|
122
122
|
)
|
|
@@ -25,6 +25,7 @@ from pytensor.graph.basic import Apply, NoParams
|
|
|
25
25
|
from pytensor.graph.fg import FunctionGraph
|
|
26
26
|
from pytensor.graph.type import Type
|
|
27
27
|
from pytensor.ifelse import IfElse
|
|
28
|
+
from pytensor.link.numba.dispatch.sparse import CSCMatrixType, CSRMatrixType
|
|
28
29
|
from pytensor.link.utils import (
|
|
29
30
|
compile_function_src,
|
|
30
31
|
fgraph_to_python,
|
|
@@ -32,6 +33,7 @@ from pytensor.link.utils import (
|
|
|
32
33
|
)
|
|
33
34
|
from pytensor.scalar.basic import ScalarType
|
|
34
35
|
from pytensor.scalar.math import Softplus
|
|
36
|
+
from pytensor.sparse import SparseTensorType
|
|
35
37
|
from pytensor.tensor.blas import BatchedDot
|
|
36
38
|
from pytensor.tensor.math import Dot
|
|
37
39
|
from pytensor.tensor.shape import Reshape, Shape, Shape_i, SpecifyShape
|
|
@@ -105,6 +107,15 @@ def get_numba_type(
|
|
|
105
107
|
dtype = np.dtype(pytensor_type.dtype)
|
|
106
108
|
numba_dtype = numba.from_dtype(dtype)
|
|
107
109
|
return numba_dtype
|
|
110
|
+
elif isinstance(pytensor_type, SparseTensorType):
|
|
111
|
+
dtype = pytensor_type.numpy_dtype
|
|
112
|
+
numba_dtype = numba.from_dtype(dtype)
|
|
113
|
+
if pytensor_type.format == "csr":
|
|
114
|
+
return CSRMatrixType(numba_dtype)
|
|
115
|
+
if pytensor_type.format == "csc":
|
|
116
|
+
return CSCMatrixType(numba_dtype)
|
|
117
|
+
|
|
118
|
+
raise NotImplementedError()
|
|
108
119
|
else:
|
|
109
120
|
raise NotImplementedError(f"Numba type not implemented for {pytensor_type}")
|
|
110
121
|
|
|
@@ -841,7 +841,7 @@ def numba_funcify_DimShuffle(op, node, **kwargs):
|
|
|
841
841
|
|
|
842
842
|
@numba_basic.numba_njit
|
|
843
843
|
def dimshuffle_inner(x, shuffle):
|
|
844
|
-
return np.reshape(x, ())
|
|
844
|
+
return np.reshape(np.ascontiguousarray(x), ())
|
|
845
845
|
|
|
846
846
|
# Without the following wrapper function we would see this error:
|
|
847
847
|
# E No implementation of function Function(<built-in function getitem>) found for signature:
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import numpy as np
|
|
1
2
|
import scipy as sp
|
|
2
3
|
import scipy.sparse
|
|
3
4
|
from numba.core import cgutils, types
|
|
5
|
+
from numba.core.imputils import impl_ret_borrowed
|
|
4
6
|
from numba.extending import (
|
|
5
7
|
NativeValue,
|
|
6
8
|
box,
|
|
9
|
+
intrinsic,
|
|
7
10
|
make_attribute_wrapper,
|
|
8
11
|
models,
|
|
12
|
+
overload,
|
|
13
|
+
overload_attribute,
|
|
14
|
+
overload_method,
|
|
9
15
|
register_model,
|
|
10
16
|
typeof_impl,
|
|
11
17
|
unbox,
|
|
@@ -16,7 +22,10 @@ class CSMatrixType(types.Type):
|
|
|
16
22
|
"""A Numba `Type` modeled after the base class `scipy.sparse.compressed._cs_matrix`."""
|
|
17
23
|
|
|
18
24
|
name: str
|
|
19
|
-
|
|
25
|
+
|
|
26
|
+
@staticmethod
|
|
27
|
+
def instance_class(data, indices, indptr, shape):
|
|
28
|
+
raise NotImplementedError()
|
|
20
29
|
|
|
21
30
|
def __init__(self, dtype):
|
|
22
31
|
self.dtype = dtype
|
|
@@ -26,6 +35,10 @@ class CSMatrixType(types.Type):
|
|
|
26
35
|
self.shape = types.UniTuple(types.int64, 2)
|
|
27
36
|
super().__init__(self.name)
|
|
28
37
|
|
|
38
|
+
@property
|
|
39
|
+
def key(self):
|
|
40
|
+
return (self.name, self.dtype)
|
|
41
|
+
|
|
29
42
|
|
|
30
43
|
make_attribute_wrapper(CSMatrixType, "data", "data")
|
|
31
44
|
make_attribute_wrapper(CSMatrixType, "indices", "indices")
|
|
@@ -139,3 +152,55 @@ def box_matrix(typ, val, c):
|
|
|
139
152
|
c.pyapi.decref(shape_obj)
|
|
140
153
|
|
|
141
154
|
return obj
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
@overload(np.shape)
|
|
158
|
+
def overload_sparse_shape(x):
|
|
159
|
+
if isinstance(x, CSMatrixType):
|
|
160
|
+
return lambda x: x.shape
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@overload_attribute(CSMatrixType, "ndim")
|
|
164
|
+
def overload_sparse_ndim(inst):
|
|
165
|
+
if not isinstance(inst, CSMatrixType):
|
|
166
|
+
return
|
|
167
|
+
|
|
168
|
+
def ndim(inst):
|
|
169
|
+
return 2
|
|
170
|
+
|
|
171
|
+
return ndim
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@intrinsic
|
|
175
|
+
def _sparse_copy(typingctx, inst, data, indices, indptr, shape):
|
|
176
|
+
def _construct(context, builder, sig, args):
|
|
177
|
+
typ = sig.return_type
|
|
178
|
+
struct = cgutils.create_struct_proxy(typ)(context, builder)
|
|
179
|
+
_, data, indices, indptr, shape = args
|
|
180
|
+
struct.data = data
|
|
181
|
+
struct.indices = indices
|
|
182
|
+
struct.indptr = indptr
|
|
183
|
+
struct.shape = shape
|
|
184
|
+
return impl_ret_borrowed(
|
|
185
|
+
context,
|
|
186
|
+
builder,
|
|
187
|
+
sig.return_type,
|
|
188
|
+
struct._getvalue(),
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
sig = inst(inst, inst.data, inst.indices, inst.indptr, inst.shape)
|
|
192
|
+
|
|
193
|
+
return sig, _construct
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
@overload_method(CSMatrixType, "copy")
|
|
197
|
+
def overload_sparse_copy(inst):
|
|
198
|
+
if not isinstance(inst, CSMatrixType):
|
|
199
|
+
return
|
|
200
|
+
|
|
201
|
+
def copy(inst):
|
|
202
|
+
return _sparse_copy(
|
|
203
|
+
inst, inst.data.copy(), inst.indices.copy(), inst.indptr.copy(), inst.shape
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
return copy
|
|
@@ -32,7 +32,7 @@ def _asarray(a, dtype, order=None):
|
|
|
32
32
|
if str(dtype) == "floatX":
|
|
33
33
|
dtype = config.floatX
|
|
34
34
|
dtype = np.dtype(dtype) # Convert into dtype object.
|
|
35
|
-
rval = np.asarray(a,
|
|
35
|
+
rval = np.asarray(a, order=order).astype(dtype)
|
|
36
36
|
# Note that dtype comparison must be done by comparing their `num`
|
|
37
37
|
# attribute. One cannot assume that two identical data types are pointers
|
|
38
38
|
# towards the same object (e.g. under Windows this appears not to be the
|
|
@@ -240,6 +240,9 @@ def convert(x, dtype=None):
|
|
|
240
240
|
The dtype to use for the conversion of `x`.
|
|
241
241
|
|
|
242
242
|
"""
|
|
243
|
+
if isinstance(x, np.ma.MaskedArray):
|
|
244
|
+
raise NotImplementedError("MaskedArrays are not supported")
|
|
245
|
+
|
|
243
246
|
if dtype is not None:
|
|
244
247
|
# in this case, the semantics are that the caller is forcing the dtype
|
|
245
248
|
x_ = _asarray(x, dtype=dtype)
|
|
@@ -2566,7 +2569,7 @@ class Abs(UnaryScalarOp):
|
|
|
2566
2569
|
return [x.zeros_like()]
|
|
2567
2570
|
|
|
2568
2571
|
if x.type in float_types:
|
|
2569
|
-
return (gz *
|
|
2572
|
+
return (gz * sign(x),)
|
|
2570
2573
|
return (gz * x / _abs(x),) # formula works for complex and real
|
|
2571
2574
|
|
|
2572
2575
|
def c_code(self, node, name, inputs, outputs, sub):
|
|
@@ -2590,7 +2593,7 @@ class Abs(UnaryScalarOp):
|
|
|
2590
2593
|
abs = Abs(same_out)
|
|
2591
2594
|
|
|
2592
2595
|
|
|
2593
|
-
class
|
|
2596
|
+
class Sign(UnaryScalarOp):
|
|
2594
2597
|
nfunc_spec = ("sign", 1, 1)
|
|
2595
2598
|
|
|
2596
2599
|
@staticmethod
|
|
@@ -2625,7 +2628,7 @@ class Sgn(UnaryScalarOp):
|
|
|
2625
2628
|
)
|
|
2626
2629
|
if type in int_types:
|
|
2627
2630
|
return f"{z} = ({x} >= 0) ? ({x} == 0) ? 0 : 1 : -1;"
|
|
2628
|
-
raise ComplexError("complex has no
|
|
2631
|
+
raise ComplexError("complex has no sign")
|
|
2629
2632
|
|
|
2630
2633
|
def c_code_cache_version(self):
|
|
2631
2634
|
s = super().c_code_cache_version()
|
|
@@ -2635,7 +2638,7 @@ class Sgn(UnaryScalarOp):
|
|
|
2635
2638
|
return s
|
|
2636
2639
|
|
|
2637
2640
|
|
|
2638
|
-
|
|
2641
|
+
sign = Sign(name="sign")
|
|
2639
2642
|
|
|
2640
2643
|
|
|
2641
2644
|
class Ceil(UnaryScalarOp):
|
|
@@ -12,7 +12,7 @@ from pytensor.graph.replace import clone_replace
|
|
|
12
12
|
from pytensor.graph.utils import MissingInputError, TestValueError
|
|
13
13
|
from pytensor.scan.op import Scan, ScanInfo
|
|
14
14
|
from pytensor.scan.utils import expand_empty, safe_new, until
|
|
15
|
-
from pytensor.tensor.basic import
|
|
15
|
+
from pytensor.tensor.basic import get_underlying_scalar_constant_value
|
|
16
16
|
from pytensor.tensor.exceptions import NotScalarConstantError
|
|
17
17
|
from pytensor.tensor.math import minimum
|
|
18
18
|
from pytensor.tensor.shape import shape_padleft, unbroadcast
|
|
@@ -147,7 +147,7 @@ def isNaN_or_Inf_or_None(x):
|
|
|
147
147
|
isStr = False
|
|
148
148
|
if not isNaN and not isInf:
|
|
149
149
|
try:
|
|
150
|
-
val =
|
|
150
|
+
val = get_underlying_scalar_constant_value(x)
|
|
151
151
|
isInf = np.isinf(val)
|
|
152
152
|
isNaN = np.isnan(val)
|
|
153
153
|
except Exception:
|
|
@@ -476,7 +476,7 @@ def scan(
|
|
|
476
476
|
n_fixed_steps = int(n_steps)
|
|
477
477
|
else:
|
|
478
478
|
try:
|
|
479
|
-
n_fixed_steps = at.
|
|
479
|
+
n_fixed_steps = at.get_underlying_scalar_constant_value(n_steps)
|
|
480
480
|
except NotScalarConstantError:
|
|
481
481
|
n_fixed_steps = None
|
|
482
482
|
|
|
@@ -674,7 +674,6 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
|
|
|
674
674
|
typeConstructor: Optional[TensorConstructorType] = None,
|
|
675
675
|
truncate_gradient: int = -1,
|
|
676
676
|
name: Optional[str] = None,
|
|
677
|
-
as_while: bool = False,
|
|
678
677
|
profile: Optional[Union[str, bool]] = None,
|
|
679
678
|
allow_gc: bool = True,
|
|
680
679
|
strict: bool = True,
|
|
@@ -1183,7 +1182,7 @@ class Scan(Op, ScanMethodsMixin, HasInnerGraph):
|
|
|
1183
1182
|
# these are states that do not feed anything back in the recurrent
|
|
1184
1183
|
# computation, and hence they do not have an initial state. The scan
|
|
1185
1184
|
# node however receives an input for each such argument, the input
|
|
1186
|
-
# in this case is just
|
|
1185
|
+
# in this case is just an int saying how many steps of this output we
|
|
1187
1186
|
# need to store. This input does not have the same dtype, nor is it the same
|
|
1188
1187
|
# type of tensor as the output, it is always a scalar int.
|
|
1189
1188
|
new_inputs += [as_tensor_variable(ons) for ons in self.outer_nitsot(inputs)]
|