title: Pytorch parameter matrix from loss function of transformation
body: <p>I have a pytorch tensor <code>k x (n+k-1)</code> tensor <code>w</code> with <code>requires_grad=True</code>. I want to transform it into a <code>kxn</code> tensor <code>p</code> also with as such: <code>p[i] = w[i][i:i+n]</code>. How do I do this, such that by calling <code>backward()</code> on a loss function of <code>p</code> in the end, I will learn <code>w</code>?</p>