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

why the attribute model in model descriptor are decorated by "@property"? #300

Open
zhangvia opened this issue Jul 24, 2024 · 3 comments
Open

Comments

@zhangvia
Copy link

I tried to compile the model using torch.compile, but the attribute ”model“ of the model descriptor cannot be set externally

@joeyballentine
Copy link
Member

Don't try to compile the model descriptors, compile the model property on the descriptor

@zhangvia
Copy link
Author

Don't try to compile the model descriptors, compile the model property on the descriptor

i didn't compile the model descriptors, i compile the model property in the descriptor. but the model property are decorated by "@Property" . it can't be set externally
the code like this will raise "can't set attribute model"

descriptor.model = torch.compile(descriptor.model)

@joeyballentine
Copy link
Member

Oh that's strange... Well, in that case you could try accessing the model directly by doing ._model instead, but since this is a private property, linters might yell at you for it.

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