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

Function GetStringAttr

tensorflow/compiler/jit/encapsulate_util.cc:40–47  ·  view source on GitHub ↗

Returns string attribute value for the node if the attribute is present, otherwise returns empty optional value.

Source from the content-addressed store, hash-verified

38// Returns string attribute value for the node if the attribute is present,
39// otherwise returns empty optional value.
40absl::optional<string> GetStringAttr(const Node& n, const string& attr_name) {
41 auto attr = n.attrs().Find(attr_name);
42 if (!attr) {
43 return absl::nullopt;
44 } else {
45 return attr->s();
46 }
47}
48
49// Adds a value to the node's list attribute.
50template <typename T>

Calls 2

FindMethod · 0.45
attrsMethod · 0.45

Tested by

no test coverage detected