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

Method SaveTensors

tensorflow/core/common_runtime/session_state.cc:66–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66Status TensorStore::SaveTensors(const std::vector<string>& output_names,
67 SessionState* session_state) {
68 mutex_lock l(lock_);
69 if (!tensors_.empty()) {
70 // Save only the tensors in output_names in the session.
71 for (const string& name : output_names) {
72 TensorId id(ParseTensorName(name));
73 const string op_name(id.first);
74 auto it = tensors_.find(op_name);
75 if (it != tensors_.end()) {
76 // Save the tensor to the session state.
77 string key = it->second.GetHandle(op_name);
78 TF_RETURN_IF_ERROR(session_state->AddTensor(key, it->second.tensor));
79 }
80 }
81 }
82 return Status::OK();
83}
84
85} // namespace tensorflow

Callers 2

RunInternalMethod · 0.80
PRunMethod · 0.80

Calls 6

ParseTensorNameFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetHandleMethod · 0.45
AddTensorMethod · 0.45

Tested by

no test coverage detected