MCPcopy Create free account
hub / github.com/apache/singa / TEST

Function TEST

test/singa/test_operation_batchnorm.cc:30–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29#ifdef USE_DNNL
30TEST(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
48TEST(DNNLOperationBatchNorm, ForwardTraining) {
49 Tensor x(Shape{2, 2});

Callers

nothing calls this directly

Calls 4

CpuBatchNormBackwardxFunction · 0.85
GaussianFunction · 0.50

Tested by

no test coverage detected