New da.tile implementation
See original GitHub issueSomeone privately sent me this da.tile implementation.
def tile(A, reps):
try:
tup = tuple(reps)
except TypeError:
tup = (reps,)
d = len(tup)
if (d < A.ndim):
tup = (1,)*(A.ndim-d) + tup
nnd = len(tup) - A.ndim # Number of new dimensions
final_shape = tup[:nnd]+tuple(i*di for i,di in zip(tup[nnd:],A.shape))
if 0 in final_shape:
XXXXX # how to make empty array?
tup = tup[nnd:]
# Don't tile along dimensions that can be broadcasted
tup = tuple(1 if l == 1 else r for l, r in zip(A.shape, tup))
if all(i==1 for i in tup):
return da.broadcast_to(A, final_shape)
name = 'tile-'+dask.base.tokenize('tile', A.name, tup)
dsk = dict(zip(itertools.product([name], *tuple(range(r*len(c)) for r,c in zip(tup, A.chunks))),
itertools.product([A.name], *tuple(r*range(len(c)) for r,c in zip(tup, A.chunks)))))
ary = da.Array(sharedict.merge(A.dask, dsk), name, tuple(r*c for r,c in zip(tup, A.chunks)), A.dtype)
return da.broadcast_to(ary, final_shape)
I haven’t yet gone through it. If anyone feels like an easy contribution this could be checked and tests could be added
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Daltile launches new visualizer | News - Floor Covering Weekly
This new digital tool allows the shopper to visualize products in one of two ways. Consumers can upload an actual photo of a...
Read more >What's new for Daltile in 2022? - YouTube
Interview with Patrick Warren and Chip Wade during The International Surfaces Event in Las Vegas NV.Join Chip & Patrick for a tour of...
Read more >Tile & Natural Stone FAQs - Daltile
Tile, grout, sealants, slip resistance, installation - there are A LOT of questions that arise ... Daltile product experts answer your most asked...
Read more >Dal-Tile overcomes manual process and reporting | Domo
Challenge: This tile manufacturer struggled to overcome manual processes and siloed systems. Solution: Dal-Tile's finance department was able to implement Domo ...
Read more >Daltile - Ceramic Tile - The Home Depot
Yes, Daltile Ceramic Tile can be returned within our 90-Day return period. What are the shipping options for Daltile Ceramic Tile? Some ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW one could probably solve this issue today by implementing
da.tile
usingda.block
.