Publish a tensor to all debug URLs of the debug op. Log an error if the publishing failed.
| 178 | // Publish a tensor to all debug URLs of the debug op. |
| 179 | // Log an error if the publishing failed. |
| 180 | Status PublishTensor(const Tensor& tensor) { |
| 181 | if (debug_urls_.empty()) { |
| 182 | return Status::OK(); |
| 183 | } else { |
| 184 | Status status = DebugIO::PublishDebugTensor(*debug_watch_key_, tensor, |
| 185 | Env::Default()->NowMicros(), |
| 186 | debug_urls_, gated_grpc_); |
| 187 | if (!status.ok()) { |
| 188 | LOG(ERROR) << "Debug node of watch key " |
| 189 | << debug_watch_key_->debug_node_name |
| 190 | << " failed to publish debug tensor data to all URLs " |
| 191 | << str_util::Join(debug_urls_, ", ") |
| 192 | << ", due to: " << status.error_message(); |
| 193 | } |
| 194 | return status; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | private: |
| 199 | const string debug_op_name_; |