MCPcopy Index your code
hub / github.com/dask/dask / constant

Function constant

dask/array/_array_expr/_overlap.py:273–286  ·  view source on GitHub ↗

Add constant slice to either side of array

(x, axis, depth, value)

Source from the content-addressed store, hash-verified

271
272
273def constant(x, axis, depth, value):
274 """Add constant slice to either side of array"""
275 chunks = list(x.chunks)
276 chunks[axis] = (depth,)
277
278 c = full_like(
279 x,
280 value,
281 shape=tuple(map(sum, chunks)),
282 chunks=tuple(chunks),
283 dtype=x.dtype,
284 )
285
286 return concatenate([c, x, c], axis=axis)
287
288
289def _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

Used in the wild real call sites across dependent graphs

searching dependent graphs…