def compute_up(expr, data, **kwargs): leaf = expr._leaves()[0] chunk = symbol('chunk', DataShape(*(tuple(map(first, data.chunks)) + (leaf.dshape.measure,)))) (chunk, chunk_expr), (agg, agg_expr) = split(expr._child, expr, chunk=chunk) inds = tuple(range(ndim(leaf))) dtype = expr.dshape.measure.to_numpy_dtype() tmp = atop( curry(compute_it, chunk_expr, [chunk], **kwargs), inds, data, inds, dtype=dtype, ) return atop( compose( curry(compute_it, agg_expr, [agg], **kwargs), curry(_concatenate2, axes=expr.axis), ), tuple(i for i in inds if i not in expr.axis), tmp, inds, dtype=dtype, )
def compute_up(expr, data, **kwargs): leaf = expr._leaves()[0] chunk = symbol( 'chunk', DataShape(*(tuple(map(first, data.chunks)) + (leaf.dshape.measure, )))) (chunk, chunk_expr), (agg, agg_expr) = split(expr._child, expr, chunk=chunk) inds = tuple(range(ndim(leaf))) dtype = expr.dshape.measure.to_numpy_dtype() tmp = atop( curry(compute_it, chunk_expr, [chunk], **kwargs), inds, data, inds, dtype=dtype, ) return atop( compose( curry(compute_it, agg_expr, [agg], **kwargs), curry(_concatenate2, axes=expr.axis), ), tuple(i for i in inds if i not in expr.axis), tmp, inds, dtype=dtype, )
def elemwise_array(expr, *data, **kwargs): leaves = expr._inputs expr_inds = tuple(range(ndim(expr)))[::-1] return atop(curry(compute_it, expr, leaves, **kwargs), expr_inds, *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data), dtype=expr.dshape.measure.to_numpy_dtype())
def elemwise_array(expr, *data, **kwargs): leaves = expr._inputs expr_inds = tuple(range(ndim(expr)))[::-1] return atop( curry(compute_it, expr, leaves, **kwargs), expr_inds, *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data) )
def compute_broadcast(expr, *data, **kwargs): expr_inds = tuple(range(ndim(expr)))[::-1] func = get_numba_ufunc(expr) return atop(func, expr_inds, *concat( (dat, tuple(range(ndim(dat))[::-1])) for dat in data), dtype=data[-1].dtype)
def elemwise_array(expr, *data, **kwargs): leaves = expr._inputs expr_inds = tuple(range(ndim(expr)))[::-1] return atop( curry(compute_it, expr, leaves, **kwargs), expr_inds, *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data), dtype=expr.dshape.measure.to_numpy_dtype() )
def compute_broadcast(expr, *data, **kwargs): expr_inds = tuple(range(ndim(expr)))[::-1] func = get_numba_ufunc(expr) return atop(func, expr_inds, *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data))
def elemwise_array(expr, *data, **kwargs): leaves = expr._inputs expr_inds = tuple(range(ndim(expr)))[::-1] return atop(curry(compute_it, expr, leaves, **kwargs), next(names), expr_inds, *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data))