(self)
| 74 | assert_allclose(result, ((np.asarray(1), np.asarray(2)), (np.asarray(3), np.asarray(4)))) |
| 75 | |
| 76 | def test_single_value(self): |
| 77 | for test_data in [5, np.array(5), torch.tensor(5)]: |
| 78 | result = ToNumpy(dtype=np.uint8)(test_data) |
| 79 | self.assertIsInstance(result, np.ndarray) |
| 80 | assert_allclose(result, np.asarray(test_data), type_test=False) |
| 81 | self.assertEqual(result.ndim, 0) |
| 82 | |
| 83 | |
| 84 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected