Also on a side note; throughout my derivations I stumble upon the derivative of a matrix with respect to a vector, which is a 3rd order tensor, how do you suggest that I go about that in pytorch; does it support generalized jacobians or should i flatten my matrix into a vector then compute the jacobian?