MCPcopy
hub / github.com/dask/dask / tile

Function tile

dask/array/creation.py:911–933  ·  view source on GitHub ↗
(A, reps)

Source from the content-addressed store, hash-verified

909
910@derived_from(np)
911def tile(A, reps):
912 try:
913 tup = tuple(reps)
914 except TypeError:
915 tup = (reps,)
916 if any(i < 0 for i in tup):
917 raise ValueError("Negative `reps` are not allowed.")
918 c = asarray(A)
919
920 if all(tup):
921 for nrep in tup[::-1]:
922 c = nrep * [c]
923 return block(c)
924
925 d = len(tup)
926 if d < c.ndim:
927 tup = (1,) * (c.ndim - d) + tup
928 if c.ndim < d:
929 shape = (1,) * (d - c.ndim) + c.shape
930 else:
931 shape = c.shape
932 shape_out = tuple(s * t for s, t in zip(shape, tup))
933 return empty(shape=shape_out, dtype=c.dtype)
934
935
936def expand_pad_value(array, pad_value):

Callers

nothing calls this directly

Calls 4

asarrayFunction · 0.90
blockFunction · 0.90
anyFunction · 0.85
allFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…