Support multiple tensor backends via NEP-47 (Python array API standard)

That’s an interesting idea and could definitely be done. You already identified that we could probably just copy a lot from the JAX implementation. This is probably better discussed as an aesara issue.