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

Function test_trace

numpy/linalg/tests/test_linalg.py:2360–2368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2358
2359
2360def test_trace():
2361 # Here we only test if selected axes are compatible
2362 # with Array API (last two). Core implementation
2363 # of `trace` is tested in `test_multiarray.py`.
2364 x = np.arange(60).reshape((3, 4, 5))
2365 actual = np.linalg.trace(x)
2366 expected = np.array([36, 116, 196])
2367
2368 assert_equal(actual, expected)
2369
2370
2371def test_cross():

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reshapeMethod · 0.80
traceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…