MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Expect

Function Expect

tensorflow/core/util/tensor_bundle/tensor_bundle_test.cc:73–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71// terms of both shape, dtype, and value
72template <typename T>
73void Expect(BundleReader* reader, const string& key,
74 const Tensor& expected_val) {
75 // Tests for Contains().
76 EXPECT_TRUE(reader->Contains(key));
77 // Tests for LookupDtypeAndShape().
78 DataType dtype;
79 TensorShape shape;
80 TF_ASSERT_OK(reader->LookupDtypeAndShape(key, &dtype, &shape));
81 EXPECT_EQ(expected_val.dtype(), dtype);
82 EXPECT_EQ(expected_val.shape(), shape);
83 // Tests for Lookup(), checking tensor contents.
84 Tensor val(expected_val.dtype(), shape);
85 TF_ASSERT_OK(reader->Lookup(key, &val));
86 test::ExpectTensorEqual<T>(val, expected_val);
87}
88
89template <class T>
90void ExpectVariant(BundleReader* reader, const string& key,

Callers

nothing calls this directly

Calls 5

LookupDtypeAndShapeMethod · 0.80
ContainsMethod · 0.45
dtypeMethod · 0.45
shapeMethod · 0.45
LookupMethod · 0.45

Tested by

no test coverage detected