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

Function TEST

tensorflow/core/framework/variant_op_registry_test.cc:107–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105} // namespace
106
107TEST(VariantOpDecodeRegistryTest, TestBasic) {
108 EXPECT_EQ(UnaryVariantOpRegistry::Global()->GetDecodeFn("YOU SHALL NOT PASS"),
109 nullptr);
110
111 auto* decode_fn =
112 UnaryVariantOpRegistry::Global()->GetDecodeFn("TEST VariantValue");
113 EXPECT_NE(decode_fn, nullptr);
114
115 VariantValue vv{true /* early_exit */};
116 Variant v = vv;
117 VariantTensorData data;
118 v.Encode(&data);
119 VariantTensorDataProto proto;
120 data.ToProto(&proto);
121 Variant encoded = std::move(proto);
122 EXPECT_TRUE((*decode_fn)(&encoded));
123 VariantValue* decoded = encoded.get<VariantValue>();
124 EXPECT_NE(decoded, nullptr);
125 EXPECT_EQ(decoded->early_exit, true);
126}
127
128TEST(VariantOpDecodeRegistryTest, TestEmpty) {
129 VariantTensorDataProto empty_proto;

Callers

nothing calls this directly

Calls 15

DecodeUnaryVariantFunction · 0.85
EXPECT_DEATHFunction · 0.85
VariantValueClass · 0.85
GetDecodeFnMethod · 0.80
set_type_nameMethod · 0.80
RegisterDecodeFnMethod · 0.80
GetDeviceCopyFnMethod · 0.80
RegisterDeviceCopyFnMethod · 0.80
GetUnaryOpFnMethod · 0.80
RegisterUnaryOpFnMethod · 0.80
GetBinaryOpFnMethod · 0.80
RegisterBinaryOpFnMethod · 0.80

Tested by

no test coverage detected