(self, dev=gpu_dev)
| 543 | self._kfloat32_int(cpu_dev) |
| 544 | |
| 545 | def _kint_float(self, dev=gpu_dev): |
| 546 | np.random.seed(0) |
| 547 | x_val = np.random.randint(0, 10, (2, 3)) |
| 548 | x = tensor.from_numpy(x_val) |
| 549 | x.to_device(dev) |
| 550 | scalar = random.random() * 100 |
| 551 | y = x + scalar |
| 552 | self.assertEqual(y.dtype, tensor.float32) |
| 553 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), x_val + scalar, 5) |
| 554 | |
| 555 | @unittest.skipIf(not singa_api.USE_CUDA, 'CUDA is not enabled') |
| 556 | def test_kint_float_gpu(self): |
no test coverage detected