Solved by phan_phan in post #4 
              
              
                Hi, 
Yes I eventually did a regression over the distribution parameters loc and scale_tril. 
So my last NN layer outputs a tensor of size [batch, 9]. 
However, a few things to note: 

The diagonal of scale_tril must be strictly positive, so I used 1 + ELU:

loc, tril, diag = outputs.split(3, dim=-1)…