Skip to content

Add dispatches for Real Op#2016

Open
jessegrabowski wants to merge 2 commits intopymc-devs:v3from
jessegrabowski:real-op-dispatch
Open

Add dispatches for Real Op#2016
jessegrabowski wants to merge 2 commits intopymc-devs:v3from
jessegrabowski:real-op-dispatch

Conversation

@jessegrabowski
Copy link
Copy Markdown
Member

We have no coverage for this Op because it doesn't have an nfunc_name. There was a concern that because numpy returns a view, we could end up with graph mutations that pytensor is not aware of. An example is:

import pytensor.tensor as pt
x = pt.dvector('x')
out = x.real[0].set(99.0)

I added some checks for this specific case, it seems like everything works ok?

@ricardoV94
Copy link
Copy Markdown
Member

ricardoV94 commented Mar 30, 2026

the input mutation is not a concern in jax which never does Inplace by default. Your test isn't strong enough because the compare py and numba (or other backend) run minimal rewrites

you need to pass the fully fledged mode as an argument or even simpler test with an already inplace set subtensor (pass inplace=true to the test) and then call the function again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants