MCPcopy Create free account
hub / github.com/dask/dask / constant

Function constant

dask/array/_array_expr/_overlap.py:274–287  ·  view source on GitHub ↗

Add constant slice to either side of array

(x, axis, depth, value)

Source from the content-addressed store, hash-verified

272
273
274def constant(x, axis, depth, value):
275 """Add constant slice to either side of array"""
276 chunks = list(x.chunks)
277 chunks[axis] = (depth,)
278
279 c = full_like(
280 x,
281 value,
282 shape=tuple(map(sum, chunks)),
283 chunks=tuple(chunks),
284 dtype=x.dtype,
285 )
286
287 return concatenate([c, x, c], axis=axis)
288
289
290def _remove_overlap_boundaries(l, r, axis, depth):

Callers 2

test_constantFunction · 0.90
boundariesFunction · 0.70

Calls 2

full_likeFunction · 0.90
concatenateFunction · 0.90

Tested by 1

test_constantFunction · 0.72