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

Method ConsumeRetvals

tensorflow/core/framework/function.cc:1006–1020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004}
1005
1006Status FunctionCallFrame::ConsumeRetvals(std::vector<Tensor>* rets,
1007 bool allow_dead_tensors) {
1008 rets->clear();
1009 rets->reserve(rets_.size());
1010 for (size_t i = 0; i < rets_.size(); ++i) {
1011 if (rets_[i].has_val) {
1012 rets->emplace_back(std::move(rets_[i].val));
1013 } else if (allow_dead_tensors) {
1014 rets->emplace_back();
1015 } else {
1016 return errors::Internal("Retval[", i, "] does not have value");
1017 }
1018 }
1019 return Status::OK();
1020}
1021
1022Status FunctionCallFrame::GetArg(int index, Tensor* val) const {
1023 if (index < 0 || static_cast<size_t>(index) >= args_.size()) {

Callers 3

RunMethod · 0.45
RunRemoteMethod · 0.45
RunMethod · 0.45

Calls 5

InternalFunction · 0.85
clearMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected