Help developing a small shim to allow PyTorch models to be used in spaCy

Weight changes

For linear layers it should be simple. It’s something like:

model.weight = nn.Parameter(F.pad(model.weight, ...)) # add classes
model.weight = nn.Parameter(model.weight[...])        # remove classes

I’m not sure about the exact params, but they should be easy to figure out. IIRC the weight layout is out_features x in_features.

use_params()

I see, that makes sense! The model. part was missing, so I was unsure how are you specifying where the params live :smile: