(self, dev)
| 2723 | self.constantOfShape_test(gpu_dev) |
| 2724 | |
| 2725 | def dropout_test(self, dev): |
| 2726 | X = np.random.randn(3, 4, 5).astype(np.float32) |
| 2727 | dy = np.random.randn(3, 4, 5).astype(np.float32) |
| 2728 | |
| 2729 | x = tensor.from_numpy(X) |
| 2730 | dy = tensor.from_numpy(dy) |
| 2731 | x.to_device(dev) |
| 2732 | dy.to_device(dev) |
| 2733 | |
| 2734 | result = autograd.dropout(x, 0.5) |
| 2735 | dx = result.creator.backward(dy.data) |
| 2736 | self.check_shape(result.shape, (3, 4, 5)) |
| 2737 | self.check_shape(dx.shape(), (3, 4, 5)) |
| 2738 | |
| 2739 | def test_dropout_cpu(self): |
| 2740 | self.dropout_test(cpu_dev) |
no test coverage detected