def METHOD_NAME(cls, name, dim, dtype, val):
    if dim[0] == 1 and dim[1] == 1:
        val = val[0]
    try:
        dtype = cls.types[dtype]
    except KeyError:
        dtype = 'int32'
    return {
        'name': 'Parameters.' + name,
        'type': dtype,
        'value': np.array(val, dtype),
    }