## Description of your problem or feature request

First, carefully read the following to determine whether or not you have a valid Pytensor issue:

- Does your issue only arise in a library that uses Pytensor (e.g. PyMC)?  If so, submit your issue to that library's issue tracker.  From there, the Pytensor-specific details can be worked out and a valid Pytensor issue can be identified.  **Issues framed primarily in third-party libraries are liable to being marked as invalid and closed.**
- Does your issue involve OS and/or environment-specific settings (e.g. installation and/or compilation issues)?  If so, create a [Discussion](https://github.com/pymc-devs/pytensor/discussions) instead.  From there, we can help determine whether or not the issue is due to faulty logic in Pytensor (i.e. a valid issue) or something specific to your local setup.


If the above does not apply, and you have an issue or feature request that's specific to Pytensor, provide a minimal, self-contained, and reproducible example (i.e. an [MWE](https://en.wikipedia.org/wiki/Minimal_reproducible_example)):

```python
[Your code here]
```

**Please provide the full tracebacks for any relevant errors and/or warning messages.**


```python
[The error output here]
```

**Please provide any additional information below.**


## Versions and main components

* Pytensor version:
* Python version:
* Operating system:
* How did you install Pytensor: (conda/pip)

<details> <summary> Pytensor config: </summary>

Place the results of `python -c "import pytensor; print(pytensor.config)"` here.

</details>
