Skip to content

Conversation

@seanmor5
Copy link
Contributor

Rather than requiring shape/type we can just use templates. The benefit is that this work supports using any Nx.Container as a model parameter. For right now we still support the old style under the param function, but this defers to the new parameter which requires templates.

There are certain places where using a container/composite parameter in place of a regular parameter makes sense. For example, if we want to initialize quantized models then we can create a quantized tensor container which represents a quantized parameter that can be converted back to a regular parameter.

In the future, I plan to unify the currently separated shape calculation and initialization process for a parameter. Realistically each parameter should just take input templates, do the shape calculation, and then initialize directly without any intermediate steps

@seanmor5 seanmor5 merged commit c4d33e5 into main Jul 24, 2024
@seanmor5 seanmor5 deleted the template-params branch July 24, 2024 11:36
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

Successfully merging this pull request may close these issues.

2 participants