Clear all cache after model load. (#8904)
This commit is contained in:
@@ -868,6 +868,8 @@ class LearnerIO : public LearnerConfiguration {
|
||||
// Will be removed once JSON takes over. Right now we still loads some RDS files from R.
|
||||
std::string const serialisation_header_ { u8"CONFIG-offset:" };
|
||||
|
||||
void ClearCaches() { this->prediction_container_ = PredictionContainer{}; }
|
||||
|
||||
public:
|
||||
explicit LearnerIO(std::vector<std::shared_ptr<DMatrix>> cache) : LearnerConfiguration{cache} {}
|
||||
|
||||
@@ -920,6 +922,7 @@ class LearnerIO : public LearnerConfiguration {
|
||||
}
|
||||
|
||||
this->need_configuration_ = true;
|
||||
this->ClearCaches();
|
||||
}
|
||||
|
||||
void SaveModel(Json* p_out) const override {
|
||||
@@ -1096,6 +1099,7 @@ class LearnerIO : public LearnerConfiguration {
|
||||
cfg_.insert(n.cbegin(), n.cend());
|
||||
|
||||
this->need_configuration_ = true;
|
||||
this->ClearCaches();
|
||||
}
|
||||
|
||||
// Save model into binary format. The code is about to be deprecated by more robust
|
||||
|
||||
Reference in New Issue
Block a user