Squashed 'subtree/rabit/' changes from b15f6cd..e08542c
e08542cfix doce95c962remove I prefix from interface, serializable now takes in pointer git-subtree-dir: subtree/rabit git-subtree-split:e08542c635
This commit is contained in:
@@ -8,17 +8,17 @@
|
||||
using namespace rabit;
|
||||
|
||||
// dummy model
|
||||
class Model : public rabit::ISerializable {
|
||||
class Model : public rabit::Serializable {
|
||||
public:
|
||||
// iterations
|
||||
std::vector<float> data;
|
||||
// load from stream
|
||||
virtual void Load(rabit::IStream &fi) {
|
||||
fi.Read(&data);
|
||||
virtual void Load(rabit::Stream *fi) {
|
||||
fi->Read(&data);
|
||||
}
|
||||
/*! \brief save the model to the stream */
|
||||
virtual void Save(rabit::IStream &fo) const {
|
||||
fo.Write(data);
|
||||
virtual void Save(rabit::Stream *fo) const {
|
||||
fo->Write(data);
|
||||
}
|
||||
virtual void InitModel(size_t n) {
|
||||
data.clear();
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
using namespace rabit;
|
||||
|
||||
// dummy model
|
||||
class Model : public rabit::ISerializable {
|
||||
class Model : public rabit::Serializable {
|
||||
public:
|
||||
// iterations
|
||||
std::vector<float> data;
|
||||
// load from stream
|
||||
virtual void Load(rabit::IStream &fi) {
|
||||
fi.Read(&data);
|
||||
virtual void Load(rabit::Stream *fi) {
|
||||
fi->Read(&data);
|
||||
}
|
||||
/*! \brief save the model to the stream */
|
||||
virtual void Save(rabit::IStream &fo) const {
|
||||
fo.Write(data);
|
||||
virtual void Save(rabit::Stream *fo) const {
|
||||
fo->Write(data);
|
||||
}
|
||||
virtual void InitModel(size_t n, float v) {
|
||||
data.clear();
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
using namespace rabit;
|
||||
|
||||
// dummy model
|
||||
class Model : public rabit::ISerializable {
|
||||
class Model : public rabit::Serializable {
|
||||
public:
|
||||
// iterations
|
||||
std::vector<float> data;
|
||||
// load from stream
|
||||
virtual void Load(rabit::IStream &fi) {
|
||||
fi.Read(&data);
|
||||
virtual void Load(rabit::Stream *fi) {
|
||||
fi->Read(&data);
|
||||
}
|
||||
/*! \brief save the model to the stream */
|
||||
virtual void Save(rabit::IStream &fo) const {
|
||||
fo.Write(data);
|
||||
virtual void Save(rabit::Stream *fo) const {
|
||||
fo->Write(data);
|
||||
}
|
||||
virtual void InitModel(size_t n) {
|
||||
data.clear();
|
||||
|
||||
Reference in New Issue
Block a user