| 28 | |
| 29 | #ifdef USE_DNNL |
| 30 | TEST(DNNLOperationBatchNorm, ForwardInference) { |
| 31 | Tensor x(Shape{2, 2}); |
| 32 | Tensor alpha(Shape{2}); |
| 33 | Tensor beta(Shape{2}); |
| 34 | Tensor moving_mean(Shape{2}); |
| 35 | Tensor moving_var(Shape{2}); |
| 36 | |
| 37 | Gaussian(0.0f, 1.0f, &x); |
| 38 | Gaussian(0.0f, 1.0f, &alpha); |
| 39 | Gaussian(0.0f, 1.0f, &beta); |
| 40 | Gaussian(0.0f, 1.0f, &moving_mean); |
| 41 | Gaussian(0.0f, 1.0f, &moving_var); |
| 42 | |
| 43 | BatchNormHandle batch_norm_handle(0u, x); |
| 44 | Tensor y = CpuBatchNormForwardInference(batch_norm_handle, x, alpha, beta, |
| 45 | moving_mean, moving_var); |
| 46 | } |
| 47 | |
| 48 | TEST(DNNLOperationBatchNorm, ForwardTraining) { |
| 49 | Tensor x(Shape{2, 2}); |
nothing calls this directly
no test coverage detected