| 1455 | } |
| 1456 | |
| 1457 | xla::StatusOr<xla::XlaOp> XlaCompiler::GetNodeToken(const string& node_name) { |
| 1458 | if (node_token_mapping_stack_.empty()) { |
| 1459 | return errors::FailedPrecondition( |
| 1460 | "Calling GetNodeToken() when node_token_mapping_stack_ is " |
| 1461 | "empty."); |
| 1462 | } |
| 1463 | auto iter = node_token_mapping_stack_.top().find(node_name); |
| 1464 | if (iter == node_token_mapping_stack_.top().end()) { |
| 1465 | return errors::FailedPrecondition("Cannot find token mapping for node ", |
| 1466 | node_name); |
| 1467 | } |
| 1468 | return iter->second; |
| 1469 | } |
| 1470 | |
| 1471 | } // namespace tensorflow |
no test coverage detected