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

Function Unzip

oneflow/api/cpp/framework/graph.cpp:100–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99template<class T1, class T2>
100const std::pair<std::vector<T1>, std::vector<T2>> Unzip(const of::HashMap<T1, T2>& hash_map) {
101 std::vector<T1> vec1;
102 std::vector<T2> vec2;
103 for (const auto& entry : hash_map) {
104 vec1.emplace_back(entry.first);
105 vec2.emplace_back(entry.second);
106 }
107 return std::make_pair(vec1, vec2);
108}
109
110Shape OfShapeToOfApiShape(const of::Shape& of_shape) {
111 std::vector<int64_t> dims(of_shape.dim_vec().begin(), of_shape.dim_vec().end());

Callers 2

LoadCheckpointMethod · 0.85
RegisterTensorsMethod · 0.85

Calls 1

emplace_backMethod · 0.45

Tested by

no test coverage detected