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

Function TEST

test/singa/test_snapshot.cc:40–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38const double double_data[] = {0.2, 0.4, 0.6, 0.8};
39
40TEST(Snapshot, WriteTest) {
41 singa::Snapshot snapshot(prefix, singa::Snapshot::kWrite);
42 singa::Tensor param_1(singa::Shape{4}), param_2(singa::Shape{2, 2});
43 param_1.CopyDataFromHostPtr(param_1_data, 4);
44 param_2.CopyDataFromHostPtr(param_2_data, 4);
45 snapshot.Write("Param_1", param_1);
46 snapshot.Write("Param_2", param_2);
47}
48
49TEST(Snapshot, ReadTest) {
50 singa::Snapshot snapshot(prefix, singa::Snapshot::kRead);

Callers

nothing calls this directly

Calls 7

ProductFunction · 0.85
ReadShapeMethod · 0.80
CopyDataFromHostPtrMethod · 0.45
WriteMethod · 0.45
sizeMethod · 0.45
ReadMethod · 0.45
AsTypeMethod · 0.45

Tested by

no test coverage detected