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

Function TEST

test/singa/test_initializer.cc:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include "singa/model/initializer.h"
21
22TEST(Initializer, Constant) {
23 singa::init::Constant x;
24 size_t n = 10;
25 singa::Tensor t(singa::Shape{n});
26 singa::FillerConf conf;
27 conf.set_value(3.1f);
28 x.Setup(conf);
29 x.Fill(t);
30 const float* xPtr = t.data<float>();
31 for (size_t i = 0; i < n; i++) EXPECT_FLOAT_EQ(xPtr[i], 3.1f);
32}
33
34TEST(Initializer, Gaussian) {
35 singa::init::Gaussian x;

Callers

nothing calls this directly

Calls 5

ToHostMethod · 0.80
sqrtFunction · 0.50
set_valueMethod · 0.45
SetupMethod · 0.45
FillMethod · 0.45

Tested by

no test coverage detected