Solved by KFrank in post #2 
              
              
                Hello Mishoo! 

Yes.  As you see, you can’t apply softplus() to a Linear.  You need 
to apply it to the output of the Linear, which is a tensor. 
I would not append output_layer (nor output_layer_mean nor 
output_layer_sigma) to linear_layers_list.  Something like this: 
        output_layer_mean = …