MCPcopy Create free account
hub / github.com/numpy/numpy / test_mem_dot

Method test_mem_dot

numpy/core/tests/test_regression.py:190–202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 assert_(buf[0]['head'] == 1)
189
190 def test_mem_dot(self):
191 # Ticket #106
192 x = np.random.randn(0, 1)
193 y = np.random.randn(10, 1)
194 # Dummy array to detect bad memory access:
195 _z = np.ones(10)
196 _dummy = np.empty((0, 10))
197 z = np.lib.stride_tricks.as_strided(_z, _dummy.shape, _dummy.strides)
198 np.dot(x, np.transpose(y), out=z)
199 assert_equal(_z, np.ones(10))
200 # Do the same for the built-in dot:
201 np.core.multiarray.dot(x, np.transpose(y), out=z)
202 assert_equal(_z, np.ones(10))
203
204 def test_arange_endian(self):
205 # Ticket #111

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
dotMethod · 0.80

Tested by

no test coverage detected