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

Function Get

tensorflow/core/lib/gtl/flatmap_test.cc:33–44  ·  view source on GitHub ↗

If map has an entry for k, return the corresponding value, else return def.

Source from the content-addressed store, hash-verified

31
32// If map has an entry for k, return the corresponding value, else return def.
33int32 Get(const NumMap& map, int64 k, int32 def = -1) {
34 auto iter = map.find(k);
35 if (iter == map.end()) {
36 EXPECT_EQ(map.count(k), 0);
37 return def;
38 } else {
39 EXPECT_EQ(map.count(k), 1);
40 EXPECT_EQ(&map.at(k), &iter->second);
41 EXPECT_EQ(iter->first, k);
42 return iter->second;
43 }
44}
45
46// Return contents of map as a sorted list of pairs.
47typedef std::vector<std::pair<int64, int32>> NumMapContents;

Callers 15

ConvertToEagerTensorFunction · 0.85
GetOrCreateMethod · 0.85
GetMethod · 0.85
TEST_FFunction · 0.85
ParseTupleNodeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85

Calls 4

findMethod · 0.45
endMethod · 0.45
countMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected