#NEWLINE# @ dispatch ( Reduction , Array ) #NEWLINE# def compute_up( expr , data , **kwargs ) : #NEWLINE# #INDENT# leaf = expr . _leaves ( ) [ 0 ] #NEWLINE# chunk = symbol ( 'chunk' , DataShape ( * ( tuple ( map ( first , data . chunks ) ) + ( leaf . dshape . measure , ) ) ) ) #NEWLINE# ( ( chunk , chunk_expr ) , ( agg , agg_expr ) ) = split ( expr . _child , expr , chunk = chunk ) #NEWLINE# inds = tuple ( range ( ndim ( leaf ) ) ) #NEWLINE# tmp = atop ( curry ( compute_it , chunk_expr , [ chunk ] , ** kwargs ) , inds , data , inds ) #NEWLINE# return atop ( compose ( curry ( compute_it , agg_expr , [ agg ] , ** kwargs ) , curry ( _concatenate2 , axes = expr . axis ) ) , tuple ( ( i for i in chunk if ( i not in expr . axis ) ) ) , tmp , inds )