| 1093 | } |
| 1094 | |
| 1095 | Status ModifySharedNameAttr(Node* new_var_op, int curr_partition_id) { |
| 1096 | std::string shared_name; |
| 1097 | TF_RETURN_IF_ERROR(GetNodeAttr(new_var_op->attrs(), "shared_name", &shared_name)); |
| 1098 | if (shared_name == "") { |
| 1099 | LOG(FATAL) << "KvVarHandleOp can not contain the shared_name attr: " |
| 1100 | << new_var_op->DebugString(); |
| 1101 | } |
| 1102 | |
| 1103 | auto offset = shared_name.find("/part_"); |
| 1104 | if (offset == std::string::npos) { |
| 1105 | shared_name = shared_name + "/part_" + std::to_string(curr_partition_id); |
| 1106 | } else { |
| 1107 | // Inference graph is not contain slot variable node, so we do not need to consider |
| 1108 | // xx/yy/zz/part_0/aa pattern here |
| 1109 | shared_name = shared_name.substr(0, offset) + |
| 1110 | "/part_" + std::to_string(curr_partition_id); |
| 1111 | } |
| 1112 | |
| 1113 | new_var_op->ClearAttr("shared_name"); |
| 1114 | new_var_op->AddAttr("shared_name", shared_name); |
| 1115 | |
| 1116 | return Status::OK(); |
| 1117 | } |
| 1118 | |
| 1119 | Node* CheckInputDefaultValNode(Node* node, int slot, int* src_slot) { |
| 1120 | for (const Edge* edge : node->in_edges()) { |
no test coverage detected