Converts torch models into PyTrees for Equinox
Project description
statedict2pytree
The goal of this package is to simplify the conversion from PyTorch models into JAX PyTrees (which can be used e.g. in Equinox). The way this works is by putting both models side my side and aligning the weights in the right order. Then, all statedict2pytree is doing, is iterating over both lists and matching the weight matrices.
Usually, if you declared the fields in the same order as in the PyTorch model, you don't have to rearrange anything -- but the option is there if you need it.
(Theoretically, you can rearrange the model in any way you like - e.g. last layer as the first layer - as long as the shapes match!)
Get Started
Installation
Run
pip install statedict2pytree
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for statedict2pytree-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc1df267cbedfe31c1eb0c59d983027dce79863b7e83bb7fba1a0703a5e2cb56 |
|
MD5 | e611100383686e00a847d06b5eae9219 |
|
BLAKE2b-256 | 3a76fdd861bd6f44e235030c94080a132a940c0c6bb62c4c40334c616d50ff9c |