Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instances for ad package missing #31

Open
aavogt opened this issue Jul 13, 2022 · 1 comment
Open

instances for ad package missing #31

aavogt opened this issue Jul 13, 2022 · 1 comment

Comments

@aavogt
Copy link

aavogt commented Jul 13, 2022

Hi I would like to use easytensor with ad but instance Quaternion (Reverse s Double) is missing. Perhaps the methods of class Quaternion can be ordinary functions on newtype Quater a = Quater (Vector a 4) with SPECIALIZE pragmas for Double and Float. Then Numeric.Quaternion.Internal.QDouble and QFloat duplication will be gone, and maybe the numbers defined by ad will also work.

@achirkin
Copy link
Owner

Thanks for the suggestion! Perhaps, we'd need to check how it plays with the unboxed unlifted element types, since the language support for this has become much better in the recent versions of ghc. Actually, I wanted to replace the two with the SIMD vectors at some point (which is currently easy, but I'm not sure if that's possible with rewrite rules alone). If you manage to do this, a PR would be greatly appreciated!
Alternatively, you can try to implement your new quaternion type and the corrseponding class instance.

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

No branches or pull requests

2 participants