(self)
| 2179 | int(a) |
| 2180 | |
| 2181 | def test_format(self): |
| 2182 | a = mx.arange(3) |
| 2183 | self.assertEqual(f"{a[0]:.2f}", "0.00") |
| 2184 | |
| 2185 | b = mx.array(0.35487) |
| 2186 | self.assertEqual(f"{b:.1f}", "0.4") |
| 2187 | |
| 2188 | with self.assertRaises(TypeError): |
| 2189 | s = f"{a:.2f}" |
| 2190 | |
| 2191 | a = mx.array([1, 2, 3]) |
| 2192 | self.assertEqual(f"{a}", "array([1, 2, 3], dtype=int32)") |
| 2193 | |
| 2194 | def test_deep_graphs(self): |
| 2195 | # The following tests should simply run cleanly without a segfault or |