Add constant slice to either side of array
(x, axis, depth, value)
| 271 | |
| 272 | |
| 273 | def 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 | |
| 289 | def _remove_overlap_boundaries(l, r, axis, depth): |
searching dependent graphs…