Here and in the above comment `val` may be a scalar if `param_dim` == 1 or a list if `param_dim`>1.