How to get an random unitary matrix from pytorch

I need a parameterized unitary matrix to construct one of my optimization problems, so how do I generate such a matrix, or how do I ensure that the matrix is unitary during the optimization process.