| 74 | // overwrites any existing attributes with the same key. |
| 75 | template <class T> |
| 76 | inline void SetNodeAttr(const string& key, const T& value, NodeDef* node) { |
| 77 | AttrValue attr_value; |
| 78 | SetAttrValue(value, &attr_value); |
| 79 | auto* attr_map = node->mutable_attr(); |
| 80 | (*attr_map)[key] = attr_value; |
| 81 | } |
| 82 | |
| 83 | template <class T> |
| 84 | inline void SetNodeTensorAttr(const string& key, const Tensor& tensor, |