Open jrichterpowell opened 2 weeks ago
Hi @jrichterpowell , thanks for putting this together! I would absolutely be open to a PR adding einops support. I'm not familiar with the internals of einops and extending it to other backends, but at a cursory glance this looks reasonable to me.
One question: how does einops know about the existence of TorchishBackend
? Does the backend need to be registered somehow?
Hey guys,
Love this tool!
Extremely useful for me as someone much more comfortable with JAX than torch. I've been using this for a project at the moment and extended some of the api surface coverage (have another issue I might open re: type promotion things), but the application I'm targeting also uses einops extensively. I hacked together preliminary support for this by subclassing the einops array backend as below, then sticking this class at the bottom of the
__init__.py
for your library. This seems more or less like the correct approach (I need to fix thelayers
implementation ofc), but I'd be curious to hear feedback if you guys have a better idea to accomplish this. It's almost identical to thepytorch
backend from einops, just changed in a few places to use theTorchish
class where needed.If it's acceptable, I'll try to open a PR soon :)