Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torch conditionals: IfElse #940

Closed
wants to merge 73 commits into from

Conversation

Ch0ronomato
Copy link
Contributor

Description

Adds the IfElse node for torch, using torch.where

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

HangenYuu and others added 2 commits July 18, 2024 12:58
* Add `OpFromGraph` wrapper around `alloc_diag`

* Remove depreciated `AllocDiag` `Op`, rename `AllocDiag2 -> AllocDiag`

* Set `inline = False`

* Add rewrite to inline all `OpFromGraph` `Op`s

* Add `is_zero_offset` helper to `Eye`

* Add `is_left_expand_dims` and `is_right_expand_dims` attributes to `DimShuffle`

* Seed `test_local_lift_through_linalg` test
@ricardoV94 ricardoV94 added enhancement New feature or request torch PyTorch backend labels Jul 18, 2024
dependabot bot and others added 5 commits July 18, 2024 18:15
* Bump actions/upload-artifact from 3 to 4

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Migrate pypi to GHA artifacts v4

* Bump download-artifact to v4

* Eliminate undefined matrix.python-version variable

* Upload/download each platform separately

* Use pattern arg to download-artifact

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Mares <[email protected]>
* Add `pt.pad`

* Refactor linspace, logspace, and geomspace to match numpy implementation

* Add `pt.flip`

* Move `flip` to `tensor/subtensor.py`, add docstring

* Move `slice_at_axis` to `tensor/subtensor` and expose it in `pytensor.tensor`
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.5.4](astral-sh/ruff-pre-commit@v0.5.2...v0.5.4)
Armavica and others added 28 commits August 15, 2024 11:16
* Fixed dead wiki links

* Fixed dead wiki links

* Deleted old documentation at doc/sandbox.
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.5.5](astral-sh/ruff-pre-commit@v0.5.4...v0.5.5)
Co-authored-by: Adrian Seyboldt <[email protected]>
Co-authored-by: Jesse Grabowski <[email protected]>
Co-authored-by: Ricardo Vieira <[email protected]>
Co-authored-by: Rob Zinkov <[email protected]>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.5.6](astral-sh/ruff-pre-commit@v0.5.5...v0.5.6)
* Add building of pyodide universal wheels

* precommit

* Fix precommit. Readd comment.

* Fix precommit2

* Minor improvement to ext_modules conditional definition

* Bump Python version so that tomllib is included

This way versioneer can read pyproject.toml

* Add wheel package to build dependencies

* Update .github/workflows/pypi.yml

* Revert unnecessary

* ruff

---------

Co-authored-by: Ben Mares <[email protected]>
fix: cast to elemwise outputs to their respective dtypes

fix: Relax scipy dependency, should work in both cases

style: black

wrap with asarray

fix: make elemwise test check against dtype in the graph

fix scalar issues

Update pytensor/scalar/basic.py

Co-authored-by: Ricardo Vieira <[email protected]>

fix test

add a clarifying comment to checking nan

fix: bool is deprecated in numpy

deps: bound scipy version

improve test
@Ch0ronomato
Copy link
Contributor Author

hmmm - this branch got messed up - i'm gonna close the branch and make a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request torch PyTorch backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding conditionals for torch