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

Method testLUSplit

tools/swig/test/testSuperTensor.py:242–251  ·  view source on GitHub ↗

Test luSplit function

(self)

Source from the content-addressed store, hash-verified

240
241 # Test (type ARGOUT_ARRAY3[ANY][ANY][ANY]) typemap
242 def testLUSplit(self):
243 "Test luSplit function"
244 print(self.typeStr, "... ", file=sys.stderr)
245 luSplit = SuperTensor.__dict__[self.typeStr + "LUSplit"]
246 supertensor = np.ones(2*2*2*2, dtype=self.typeCode).reshape((2, 2, 2, 2))
247 answer_upper = [[[[0, 0], [0, 1]], [[0, 1], [1, 1]]], [[[0, 1], [1, 1]], [[1, 1], [1, 1]]]]
248 answer_lower = [[[[1, 1], [1, 0]], [[1, 0], [0, 0]]], [[[1, 0], [0, 0]], [[0, 0], [0, 0]]]]
249 lower, upper = luSplit(supertensor)
250 self.assertEqual((lower == answer_lower).all(), True)
251 self.assertEqual((upper == answer_upper).all(), True)
252
253######################################################################
254

Callers

nothing calls this directly

Calls 3

printFunction · 0.85
reshapeMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected