| 421 | } |
| 422 | |
| 423 | StatusOr<ComputationStats> Client::GetComputationStats( |
| 424 | const XlaComputation& computation, |
| 425 | const DebugOptions& debug_options) const { |
| 426 | ComputationGraphStatsRequest request; |
| 427 | |
| 428 | // TODO(b/74197823): Find a way to avoid the copy of the hlo proto. |
| 429 | *request.mutable_computation() = computation.proto(); |
| 430 | *request.mutable_debug_options() = debug_options; |
| 431 | ComputationStatsResponse response; |
| 432 | |
| 433 | VLOG(1) << "making computation graph stats request"; |
| 434 | Status s = stub_->GetComputationGraphStats(&request, &response); |
| 435 | VLOG(1) << "done with request"; |
| 436 | |
| 437 | if (!s.ok()) { |
| 438 | return s; |
| 439 | } |
| 440 | CHECK(response.has_stats()); |
| 441 | return response.stats(); |
| 442 | } |
| 443 | |
| 444 | StatusOr<std::unique_ptr<ProgramShape>> Client::GetComputationShape( |
| 445 | const XlaComputation& computation) { |
nothing calls this directly
no test coverage detected