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

Method RunStep

tensorflow/core/distributed_runtime/master_test.cc:94–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 Status RunStep(const string& handle,
95 const std::vector<std::pair<string, const Tensor*> >& feed,
96 const std::map<string, Tensor*>& fetch) {
97 ::grpc::ClientContext ctx;
98 RunStepRequest req;
99 req.set_session_handle(handle);
100 for (const auto& p : feed) {
101 const string& feed_name = p.first;
102 const Tensor* feed_tensor = p.second;
103 auto f = req.add_feed();
104 f->set_name(feed_name);
105 feed_tensor->AsProtoTensorContent(f->mutable_tensor());
106 }
107 for (const auto& p : fetch) {
108 const string& fetch_name = p.first;
109 req.add_fetch(fetch_name);
110 }
111 RunStepResponse resp;
112 const Status s = FromGrpcStatus(master_->RunStep(&ctx, req, &resp));
113 if (s.ok()) {
114 for (const auto& fetch_resp : resp.tensor()) {
115 auto it = fetch.find(fetch_resp.name());
116 CHECK(it != fetch.end());
117 CHECK(it->second->FromProto(fetch_resp.tensor()));
118 }
119 }
120 return s;
121 }
122
123 Status CloseSession(const string& handle) {
124 ::grpc::ClientContext ctx;

Callers

nothing calls this directly

Calls 12

FromGrpcStatusFunction · 0.85
set_session_handleMethod · 0.80
AsProtoTensorContentMethod · 0.80
nameMethod · 0.65
add_feedMethod · 0.45
set_nameMethod · 0.45
add_fetchMethod · 0.45
okMethod · 0.45
tensorMethod · 0.45
findMethod · 0.45
endMethod · 0.45
FromProtoMethod · 0.45

Tested by

no test coverage detected