Oh okay, so maybe make a parameter tensor of size mx(n-1) and copy it into a mxn tensor. Manually make the last row such that weights sum to 1 and use that tensor in nn functional interface.
Start by creating a nn Module, store the mxn-1 tensor in init function, in each forward function create the bigger mxn weight matrix and you should be fine