dmlc--dgl
9caff61777
* fix script * t * fix weird bugs * fix * fix * upload * fix * fix * lint * fix * tmp * fix serialization * fix * fix lint * fix message * fix * lint * address comment * fix * lint * fix * fix * fix * Remove duplicate serialization for meta graph Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
29 行
582 B
C++
29 行
582 B
C++
/*!
|
|
* Copyright (c) 2018 by Contributors
|
|
* \file graph/graph_serializer.cc
|
|
* \brief DGL serializer APIs
|
|
*/
|
|
|
|
#ifndef DGL_GRAPH_SERIALIZER_H_
|
|
#define DGL_GRAPH_SERIALIZER_H_
|
|
|
|
#include <memory>
|
|
namespace dgl {
|
|
|
|
// Util class to call the private/public empty constructor, which is needed for serialization
|
|
class Serializer {
|
|
public:
|
|
template <typename T>
|
|
static T* new_object() {
|
|
return new T();
|
|
}
|
|
|
|
template <typename T>
|
|
static std::shared_ptr<T> make_shared() {
|
|
return std::shared_ptr<T>(new T());
|
|
}
|
|
};
|
|
} // namespace dgl
|
|
|
|
#endif // DGL_GRAPH_SERIALIZER_H_
|