MCPcopy
hub / github.com/dask/dask / dotmany

Function dotmany

dask/array/core.py:355–374  ·  view source on GitHub ↗

Dot product of many aligned chunks >>> x = np.array([[1, 2], [1, 2]]) >>> y = np.array([[10, 20], [10, 20]]) >>> dotmany([x, x, x], [y, y, y]) array([[ 90, 180], [ 90, 180]]) Optionally pass in functions to apply to the left and right chunks >>> dotmany([x, x, x

(A, B, leftfunc=None, rightfunc=None, **kwargs)

Source from the content-addressed store, hash-verified

353
354
355def dotmany(A, B, leftfunc=None, rightfunc=None, **kwargs):
356 """Dot product of many aligned chunks
357
358 >>> x = np.array([[1, 2], [1, 2]])
359 >>> y = np.array([[10, 20], [10, 20]])
360 >>> dotmany([x, x, x], [y, y, y])
361 array([[ 90, 180],
362 [ 90, 180]])
363
364 Optionally pass in functions to apply to the left and right chunks
365
366 >>> dotmany([x, x, x], [y, y, y], rightfunc=np.transpose)
367 array([[150, 150],
368 [150, 150]])
369 """
370 if leftfunc:
371 A = map(leftfunc, A)
372 if rightfunc:
373 B = map(rightfunc, B)
374 return sum(map(partial(np.dot, **kwargs), A, B))
375
376
377def _concatenate2(arrays, axes=None):

Callers

nothing calls this directly

Calls 1

sumFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…