@@ -43,14 +43,32 @@ function MTKParameters(
43
43
p = merge (defs, p)
44
44
p = merge (Dict (unwrap (k) => v for (k, v) in p),
45
45
Dict (default_toterm (unwrap (k)) => v for (k, v) in p))
46
- p = Dict (k => fixpoint_sub (v, p) for (k, v) in p)
46
+ p = Dict (unwrap (k) => fixpoint_sub (v, p) for (k, v) in p)
47
47
for (sym, _) in p
48
48
if istree (sym) && operation (sym) === getindex &&
49
49
first (arguments (sym)) in all_ps
50
50
error (" Scalarized parameter values ($sym ) are not supported. Instead of `[p[1] => 1.0, p[2] => 2.0]` use `[p => [1.0, 2.0]]`" )
51
51
end
52
52
end
53
53
54
+ missing_params = Set ()
55
+ for idxmap in (ic. tunable_idx, ic. discrete_idx, ic. constant_idx, ic. nonnumeric_idx)
56
+ for sym in keys (idxmap)
57
+ sym isa Symbol && continue
58
+ haskey (p, sym) && continue
59
+ hasname (sym) && haskey (p, getname (sym)) && continue
60
+ ttsym = default_toterm (sym)
61
+ haskey (p, ttsym) && continue
62
+ hasname (ttsym) && haskey (p, getname (ttsym)) && continue
63
+
64
+ istree (sym) && operation (sym) === getindex && haskey (p, arguments (sym)[1 ]) &&
65
+ continue
66
+ push! (missing_params, sym)
67
+ end
68
+ end
69
+
70
+ isempty (missing_params) || throw (MissingVariablesError (collect (missing_params)))
71
+
54
72
tunable_buffer = Tuple (Vector {temp.type} (undef, temp. length)
55
73
for temp in ic. tunable_buffer_sizes)
56
74
disc_buffer = Tuple (Vector {temp.type} (undef, temp. length)
0 commit comments