| 67 | } |
| 68 | |
| 69 | std::tuple<std::vector<std::string>, std::vector<std::shared_ptr<one::Tensor>>> |
| 70 | VariableTensorMgr::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 | |
| 80 | void VariableTensorMgr::Reset() { |
| 81 | std::map<std::string, std::shared_ptr<one::Tensor>>().swap(variables_); |