MCPcopy Index your code
hub / github.com/numpy/numpy / test_mem_dot

Method test_mem_dot

numpy/_core/tests/test_regression.py:210–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

208 assert_(buf[0]['head'] == 1)
209
210 def test_mem_dot(self):
211 # Ticket #106
212 x = np.random.randn(0, 1)
213 y = np.random.randn(10, 1)
214 # Dummy array to detect bad memory access:
215 _z = np.ones(10)
216 _dummy = np.empty((0, 10))
217 z = as_strided(_z, _dummy.shape, _dummy.strides)
218 np.dot(x, np.transpose(y), out=z)
219 assert_equal(_z, np.ones(10))
220 # Do the same for the built-in dot:
221 np._core.multiarray.dot(x, np.transpose(y), out=z)
222 assert_equal(_z, np.ones(10))
223
224 def test_arange_endian(self):
225 # Ticket #111

Callers

nothing calls this directly

Calls 3

as_stridedFunction · 0.90
assert_equalFunction · 0.90
dotMethod · 0.80

Tested by

no test coverage detected