@@ -19,7 +19,7 @@ function stage(ctx::Context, node::Map)
19
19
f = node. f
20
20
for i= eachindex (domains)
21
21
inps = map (x-> chunks (x)[i], inputs)
22
- thunks[i] = Thunk ((args... ) -> map (f, args... ), inps... )
22
+ thunks[i] = Thunk ((args... ) -> map (f, args... ), map (inp -> nothing => inp, inps) ... )
23
23
end
24
24
DArray (Any, domain (primary), domainchunks (primary), thunks)
25
25
end
40
40
41
41
function stage (ctx:: Context , r:: ReduceBlock )
42
42
inp = stage (ctx, r. input)
43
- reduced_parts = map (x -> Thunk (r. op, x; get_result= r. get_result), chunks (inp))
44
- Thunk ((xs... ) -> r. op_master (xs), reduced_parts... ; meta= true )
43
+ reduced_parts = map (x -> Thunk (r. op, nothing => x; get_result= r. get_result), chunks (inp))
44
+ Thunk ((xs... ) -> r. op_master (xs), map (part -> nothing => part, reduced_parts) ... ; meta= true )
45
45
end
46
46
47
47
reduceblock_async (f, x:: ArrayOp ; get_result= true ) = ReduceBlock (f, f, x, get_result)
@@ -126,10 +126,10 @@ function stage(ctx::Context, r::Reducedim)
126
126
inp = cached_stage (ctx, r. input)
127
127
thunks = let op = r. op, dims= r. dims
128
128
# do reducedim on each block
129
- tmp = map (p-> Thunk (b-> reduce (op,b,dims= dims), p), chunks (inp))
129
+ tmp = map (p-> Thunk (b-> reduce (op,b,dims= dims), nothing => p), chunks (inp))
130
130
# combine the results in tree fashion
131
131
treereducedim (tmp, r. dims) do x,y
132
- Thunk (op, x, y)
132
+ Thunk (op, nothing => x, nothing => y)
133
133
end
134
134
end
135
135
c = domainchunks (inp)
0 commit comments