| 27 | } |
| 28 | |
| 29 | void SetAttr(TF_Graph* graph, TF_Operation* op, const char* attr_name, |
| 30 | TF_Buffer* attr_value_proto, TF_Status* status) { |
| 31 | AttrValue attr_val; |
| 32 | if (!attr_val.ParseFromArray(attr_value_proto->data, |
| 33 | attr_value_proto->length)) { |
| 34 | status->status = |
| 35 | tensorflow::errors::InvalidArgument("Invalid AttrValue proto"); |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | mutex_lock l(graph->mu); |
| 40 | op->node.AddAttr(attr_name, attr_val); |
| 41 | RecordMutation(graph, *op, "setting attribute"); |
| 42 | } |
| 43 | |
| 44 | void ClearAttr(TF_Graph* graph, TF_Operation* op, const char* attr_name, |
| 45 | TF_Status* status) { |
nothing calls this directly
no test coverage detected