MCPcopy Create free account
hub / github.com/davisking/dlib / test_matrix_from_object_with_2d_shape

Function test_matrix_from_object_with_2d_shape

tools/python/test/test_matrix.py:61–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60if have_numpy:
61 def test_matrix_from_object_with_2d_shape():
62 m1 = numpy.array([[0, 1, 2],
63 [3, 4, 5],
64 [6, 7, 8]])
65 m = matrix(m1)
66 assert m.nr() == 3
67 assert m.nc() == 3
68 assert m.shape == (3, 3)
69 assert len(m) == 3
70 assert repr(m) == "< dlib.matrix containing: \n0 1 2 \n3 4 5 \n6 7 8 >"
71 assert str(m) == "0 1 2 \n3 4 5 \n6 7 8"
72
73
74 def test_matrix_from_object_without_2d_shape():

Callers

nothing calls this directly

Calls 7

matrixClass · 0.90
lenFunction · 0.85
reprFunction · 0.85
strClass · 0.85
arrayMethod · 0.45
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected