|
106 | 106 | ref_result = 16.881943016134134
|
107 | 107 | print(math.isclose(result, ref_result, rel_tol=1E-6, abs_tol=1E-6))
|
108 | 108 |
|
109 |
| -a = np.array([[0, 1, 2], [5, 4, 8], [4, 4, 8] ], dtype=np.int16) |
110 |
| -result = (np.linalg.norm(a,axis=1)) |
111 |
| -ref_result = np.array([2.236068, 10.24695, 9.797959]) #Problem when element > 10? |
| 109 | + |
| 110 | +a = np.array([[0, 1, 2], [3, 4 ,5], [5, 4, 8], [4, 4, 8] ], dtype=np.int16) |
| 111 | +result = (np.linalg.norm(a,axis=0)) # fails on low tolerance when result >10? |
| 112 | +ref_result = np.array([7.071068, 7.0, 12.52996]) |
112 | 113 | for i in range(3):
|
113 | 114 | print(math.isclose(result[i], ref_result[i], rel_tol=1E-6, abs_tol=1E-6))
|
| 115 | + |
| 116 | +a = np.array([[0, 1, 2], [3, 4 ,5], [5, 4, 8], [4, 4, 8] ], dtype=np.int16) |
| 117 | +result = (np.linalg.norm(a,axis=1)). # fails on low tolerance when result >10? |
| 118 | +ref_result = np.array([2.236068, 7.071068, 10.24695, 9.797959]) |
| 119 | +for i in range(4): |
| 120 | + print(math.isclose(result[i], ref_result[i], rel_tol=1E-6, abs_tol=1E-6)) |
114 | 121 |
|
115 | 122 | if use_ulab:
|
116 | 123 | print(np.linalg.trace(np.eye(3)))
|
|
0 commit comments