MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Dump

Method Dump

oneflow/core/framework/variable_tensor_mgr.cpp:69–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69std::tuple<std::vector<std::string>, std::vector<std::shared_ptr<one::Tensor>>>
70VariableTensorMgr::Dump() {
71 std::vector<std::string> variable_op_names;
72 std::vector<std::shared_ptr<one::Tensor>> variable_tensors;
73 for (const auto& x : variables_) {
74 variable_op_names.push_back(x.first);
75 variable_tensors.push_back(x.second);
76 }
77 return std::make_tuple(variable_op_names, variable_tensors);
78}
79
80void VariableTensorMgr::Reset() {
81 std::map<std::string, std::shared_ptr<one::Tensor>>().swap(variables_);

Callers 1

TestCacheFunction · 0.45

Calls 1

push_backMethod · 0.80

Tested by 1

TestCacheFunction · 0.36