Hi Matthew,
That’s really cool! I’m looking forward to this integration.
Questions


What kind of layer do you want to enlarge/shrink? Is it only for linear modules, or do you also consider things like conv? In general you’ll probably need to fiddle with the weight tensor (just reassign the attr with the new value).


As above


I’m not sure what’s the exact purpose of this context manager so it’s hard for me to answer that. I’ll need more details.


Wrapper code
It depends on what version are you targetting. This is using things that are outdated in master, but looks good from the level of 0.3.
About the dropout - yes, multiplying y_var and dy_data by the mask should be enough. Although I’d say it’s a bit of a surprising interface (what makes dropout so special?).
For serialization of modules you probably want to use state_dict() and load_state_dict(). Also torch.load and torch.save will be more efficient with tensors than pickle, but both ways work.

Hope this helps! Let us know if you have any other questions!