How to change manually the size of a layer without breaking autograd?

How would you do this in 0.3.0 before using .data was a bad idea? I’m encountering a similar challenge here.