-
Notifications
You must be signed in to change notification settings - Fork 495
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
Module derive relies on B
generics for Backend
#452
Comments
Would it be all right if I look into this issue? |
You can work on this if you want! |
Thanks. I will try. |
I would like to hear your thoughts about my solution before starting to write code. I'm thinking about adding a helper attribute for letting users provide backend information. An auto-detecting approach seems impossible because it would be too unreliable without the help of type information, e.g., checking if the name of a bound equals The syntax of the proposed approach is:
I'm also thinking about adding static assertions with no runtime overhead for verifying if the
The not-implementing assertion can be done by the approach suggested by this thread. I haven't dug into how to verify being some trait or being a subtrait, but I feel it's doable. Plus, here are some note of my design choices:
|
Hmm, not easy to answer, but I would say that the macro should be the same as the module. Maybe something like: #[derive(Module)]
#[module(backend = "C")]
pub struct MyModule<C: Backend> {
fc1: Linear<C>,
} |
I am sorry for the late reply. I have several questions and would greatly appreciate it if you could clarify a little more.
|
Describe the bug
Getting this error:
To Reproduce
Declare the following:
Expected behavior
Should work just like for B: Backend
The text was updated successfully, but these errors were encountered: