Replies: 1 comment
-
The only requirement for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have constructed a metaclass which construct classes generating dynamically their
__init__
method based on attributes defined in the class body.Now I think it shouldn't be an issue to register these classes through a
register_dataclass
but the only thing that restrain me to do so is that the arguments passed to the__init__
method needs to be the one saved as instance attributes. That means for example I cannot register a class which store an instance attribute that reesults from some transformation of some of the__init__
parameters, i.e. when initializing tensor's weights, I know the shape of the tensor and I randomly sample from a certain probability distribution the actual weights before storing the tensor as an instance attribute.I have looked up the
register_dataclass
function defintion and it is based on theregister_dataclass_node
method which is defined through a c++ api. Is it possible to useregister_dataclass_node
to register the classes I have described above?Thanks
Beta Was this translation helpful? Give feedback.
All reactions