MCPcopy
hub / github.com/dask/dask / test_elemwise_on_scalars

Function test_elemwise_on_scalars

dask/array/tests/test_array_core.py:1143–1159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1141
1142
1143def test_elemwise_on_scalars():
1144 nx = np.arange(10, dtype=np.int64)
1145 ny = np.arange(10, dtype=np.int32)
1146 nz = nx.sum() * ny
1147
1148 dx = from_array(nx, chunks=(5,))
1149 dy = from_array(ny, chunks=(5,))
1150 dz = dx.sum() * dy
1151
1152 if NUMPY_GE_200:
1153 assert_eq(dz, nz)
1154 else:
1155 # Dask 0-d arrays do not behave like numpy scalars for type promotion
1156 assert_eq(dz, nz, check_dtype=False)
1157 assert nz.dtype == np.int32
1158 assert dz.dtype == np.int64
1159 assert dz.compute().dtype == np.int64
1160
1161
1162def test_elemwise_with_ndarrays():

Callers

nothing calls this directly

Calls 5

from_arrayFunction · 0.90
assert_eqFunction · 0.90
arangeMethod · 0.45
sumMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…