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

Method RunCallable

tensorflow/core/distributed_runtime/rpc/grpc_session.cc:436–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436Status GrpcSession::RunCallable(CallableHandle handle,
437 const std::vector<Tensor>& feed_tensors,
438 std::vector<Tensor>* fetch_tensors,
439 RunMetadata* run_metadata) {
440 RunCallableRequest req;
441 TF_RETURN_IF_ERROR(Handle(req.mutable_session_handle()));
442 req.set_handle(handle);
443 req.set_request_id(GetUniqueRequestId());
444 for (const Tensor& feed : feed_tensors) {
445 feed.AsProtoTensorContent(req.mutable_feed()->Add());
446 }
447
448 RunCallableResponse resp;
449 CallOptions call_options;
450 call_options.SetTimeout(options_.config.operation_timeout_in_ms());
451 TF_RETURN_IF_ERROR(master_->RunCallable(&call_options, &req, &resp));
452 for (const TensorProto& fetch : resp.fetch()) {
453 Tensor fetch_tensor;
454 if (!fetch_tensor.FromProto(cpu_allocator(), fetch)) {
455 return errors::Internal(
456 "Could not parse fetched tensor data in response from master.");
457 }
458 fetch_tensors->push_back(std::move(fetch_tensor));
459 }
460 return Status::OK();
461}
462
463Status GrpcSession::ReleaseCallable(CallableHandle handle) {
464 ReleaseCallableRequest req;

Callers 2

TESTFunction · 0.45
RunCallableHandlerMethod · 0.45

Calls 12

GetUniqueRequestIdFunction · 0.85
cpu_allocatorFunction · 0.85
InternalFunction · 0.85
set_request_idMethod · 0.80
AsProtoTensorContentMethod · 0.80
SetTimeoutMethod · 0.80
HandleClass · 0.50
set_handleMethod · 0.45
AddMethod · 0.45
fetchMethod · 0.45
FromProtoMethod · 0.45
push_backMethod · 0.45

Tested by 1

TESTFunction · 0.36