Yeah you can use the nn functional module.
Lets assume the fully connected layer has weight matrix of size mxn and input has dimension n.
So basically you want sum of all columns of matrix to 1 as far as I could understand from your question (sum of weights coming out of neuron)
Basically instead of m*n parameters you will have (m-1)*n parameters, last row of the weight matrix can be found (as sum of weights in column is 1)
You should look at brilliant answer 387 @tom wrote for starting.
Overview:
You’ll need to define weight matrix with parameters (include the sum to 1 condition on your own ) everytime in forward pass.
Get back if you need help