| 94 | } |
| 95 | |
| 96 | float GetFloatAttr(const NodeDef& node, const string& attr_name) { |
| 97 | CHECK(HasAttr(node, attr_name)); |
| 98 | const auto& attr = node.attr().at(attr_name); |
| 99 | CHECK_EQ(attr.value_case(), AttrValue::kF); |
| 100 | return attr.f(); |
| 101 | } |
| 102 | |
| 103 | bool GetBoolAttr(const NodeDef& node, const string& attr_name) { |
| 104 | CHECK(HasAttr(node, attr_name)); |