MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Reset

Method Reset

tensorflow/compiler/xla/python/tpu_driver/grpc_tpu_driver.cc:1013–1033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011}
1012
1013Status GrpcTpuDriver::Reset() {
1014 auto stub = CreateTpuDriverStub(config_, creds_);
1015 ::grpc::ClientContext ctx;
1016 ctx.set_fail_fast(false);
1017 ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));
1018 ResetRequest req;
1019 ResetResponse resp;
1020 ::grpc::Status status = stub->Reset(&ctx, req, &resp);
1021 if (!status.ok()) {
1022 LOG(ERROR) << "Failed to reset the gRPC driver: " << status.error_code()
1023 << ": " << status.error_message() << ": "
1024 << status.error_details();
1025 return xla::Status(tensorflow::error::Code(status.error_code()),
1026 absl::StrCat("Failed to reset TPU driver. Error was: ",
1027 status.error_message(),
1028 ". Details: ", status.error_details()));
1029 }
1030 streams_.clear();
1031 host_stream_.reset();
1032 return Close();
1033}
1034
1035Status GrpcTpuDriver::Close() {
1036 auto stub = CreateTpuDriverStub(config_, creds_);

Callers

nothing calls this directly

Calls 6

error_codeMethod · 0.80
StatusClass · 0.50
StrCatFunction · 0.50
okMethod · 0.45
clearMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected