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

Function TEST

test/singa/test_batchnorm.cc:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using namespace singa;
28
29TEST(BatchNorm, Setup) {
30 BatchNorm batchnorm;
31 // EXPECT_EQ("BatchNorm", batchnorm.layer_type());
32
33 singa::LayerConf conf;
34 singa::BatchNormConf *batchnorm_conf = conf.mutable_batchnorm_conf();
35 batchnorm_conf->set_factor(0.01);
36 batchnorm.Setup(Shape{2, 4, 4}, conf);
37
38 EXPECT_FLOAT_EQ(0.01f, batchnorm.factor());
39 EXPECT_EQ(2u, batchnorm.channels());
40 EXPECT_EQ(4u, batchnorm.height());
41 EXPECT_EQ(4u, batchnorm.width());
42}
43
44TEST(BatchNorm, Forward) {
45 BatchNorm batchnorm;

Callers

nothing calls this directly

Calls 14

factorMethod · 0.80
set_bnScaleMethod · 0.80
set_bnBiasMethod · 0.80
set_runningMeanMethod · 0.80
set_runningVarianceMethod · 0.80
shapeMethod · 0.80
SetupMethod · 0.45
channelsMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
CopyDataFromHostPtrMethod · 0.45
ForwardMethod · 0.45

Tested by

no test coverage detected