| 144 | } |
| 145 | |
| 146 | void CopyNodeAttr(const NodeDef& source, const string& source_key, |
| 147 | const string& dest_key, NodeDef* dest) { |
| 148 | CHECK_NE(0, source.attr().count(source_key)) |
| 149 | << "No key '" << source_key << "' found in " << source.DebugString(); |
| 150 | (*(dest->mutable_attr()))[dest_key] = source.attr().at(source_key); |
| 151 | } |
| 152 | |
| 153 | Tensor GetNodeTensorAttr(const NodeDef& node, const string& key) { |
| 154 | TensorProto tensor_proto = node.attr().at(key).tensor(); |