MCPcopy
hub / github.com/numpy/numpy / consistent_subclass

Function consistent_subclass

numpy/linalg/tests/test_linalg.py:57–61  ·  view source on GitHub ↗
(out, in_)

Source from the content-addressed store, hash-verified

55
56
57def consistent_subclass(out, in_):
58 # For ndarray subclass input, our output should have the same subclass
59 # (non-ndarray input gets converted to ndarray).
60 return type(out) is (type(in_) if isinstance(in_, np.ndarray)
61 else np.ndarray)
62
63
64old_assert_almost_equal = assert_almost_equal

Callers 8

doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85
doMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…