Load directly to CPU, and latter transfer to other devices.
| 68 | |
| 69 | // Load directly to CPU, and latter transfer to other devices. |
| 70 | void LoadParam(const std::string &path, Variable *out) { |
| 71 | model_parser::BinaryFileReader reader(path); |
| 72 | model_parser::pb::LoDTensorDeserializer loader; |
| 73 | LoadLoDTensor(&loader, &reader, out); |
| 74 | } |
| 75 | |
| 76 | bool IsPersistable(const cpp::VarDesc &var) { |
| 77 | if (var.Persistable() && var.GetType() != VarDescAPI::Type::FEED_MINIBATCH && |