MCPcopy
hub / github.com/numpy/numpy / testLUSplit

Method testLUSplit

tools/swig/test/testSuperTensor.py:253–262  ·  view source on GitHub ↗

Test luSplit function

(self)

Source from the content-addressed store, hash-verified

251
252 # Test (type ARGOUT_ARRAY3[ANY][ANY][ANY]) typemap
253 def testLUSplit(self):
254 "Test luSplit function"
255 print(self.typeStr, "... ", file=sys.stderr)
256 luSplit = SuperTensor.__dict__[self.typeStr + "LUSplit"]
257 supertensor = np.ones(2 * 2 * 2 * 2, dtype=self.typeCode).reshape((2, 2, 2, 2))
258 answer_upper = [[[[0, 0], [0, 1]], [[0, 1], [1, 1]]], [[[0, 1], [1, 1]], [[1, 1], [1, 1]]]] # noqa: E501
259 answer_lower = [[[[1, 1], [1, 0]], [[1, 0], [0, 0]]], [[[1, 0], [0, 0]], [[0, 0], [0, 0]]]] # noqa: E501
260 lower, upper = luSplit(supertensor)
261 self.assertEqual((lower == answer_lower).all(), True)
262 self.assertEqual((upper == answer_upper).all(), True)
263
264######################################################################
265

Callers

nothing calls this directly

Calls 2

reshapeMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected