Skip to content

stop Mul/DivLinearOperator converting static scalars to jax arrays#222

Merged
jpbrodrick89 merged 3 commits into
mainfrom
jpb/static-scalar
May 15, 2026
Merged

stop Mul/DivLinearOperator converting static scalars to jax arrays#222
jpbrodrick89 merged 3 commits into
mainfrom
jpb/static-scalar

Conversation

@jpbrodrick89
Copy link
Copy Markdown
Collaborator

I realised that our psd/nsd tags weren't propagating with simple primitive multipliers, the culprit was simply jnp.asarray converting scalar to jax arrays which escaped detection, using np.ndim works in all cases.

The one things I'm not really sure about is whether it was worth adding the unit diagonal 1 * and / 1 tests, it seems a bit niche but probably harmless. Happy to remove or keep as you prefer.

The way I updated the tests to catch this is somewhat nuanced and I'd appreciate a look whenever you get a small moment (no rush on this one!).

@patrick-kidger
Copy link
Copy Markdown
Owner

patrick-kidger commented May 13, 2026

If I'm reading this correctly then I think your changes LGTM!

@jpbrodrick89 jpbrodrick89 merged commit 2f0e083 into main May 15, 2026
1 check passed
@patrick-kidger patrick-kidger deleted the jpb/static-scalar branch May 15, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants