对具有不同 numblocks 的两个数组进行操作
Operation over two arrays with different numblocks
我正在尝试为 dask 数组实现 take_along_axis。
映射接受来自 dask 数组 A
的块的操作以及来自 dask 数组 B
的相应块的标准方法是什么?
我应该在 A.numblocks != B.numblocks
时使用重新分块吗?
重新分块没问题。 Dask.array 算法在内部相当频繁地对齐块。您也可以考虑使用 map_blocks
或 atop
之类的函数(如果它们适合您的话)。 Dask 开发人员优化了这些。
- http://dask.pydata.org/en/latest/array-api.html#dask.array.core.atop
- http://dask.pydata.org/en/latest/array-api.html#dask.array.core.map_blocks
这些仅在您构建自己的算法时才重要。 dask.arrays 的正常使用并不需要明确考虑重新分块。
我正在尝试为 dask 数组实现 take_along_axis。
映射接受来自 dask 数组 A
的块的操作以及来自 dask 数组 B
的相应块的标准方法是什么?
我应该在 A.numblocks != B.numblocks
时使用重新分块吗?
重新分块没问题。 Dask.array 算法在内部相当频繁地对齐块。您也可以考虑使用 map_blocks
或 atop
之类的函数(如果它们适合您的话)。 Dask 开发人员优化了这些。
- http://dask.pydata.org/en/latest/array-api.html#dask.array.core.atop
- http://dask.pydata.org/en/latest/array-api.html#dask.array.core.map_blocks
这些仅在您构建自己的算法时才重要。 dask.arrays 的正常使用并不需要明确考虑重新分块。