| 4740 | |
| 4741 | |
| 4742 | void test_serialization() |
| 4743 | { |
| 4744 | print_spinner(); |
| 4745 | |
| 4746 | using net_type = loss_mean_squared<fc<1, input<matrix<double>>>>; |
| 4747 | net_type net, net2; |
| 4748 | |
| 4749 | std::ostringstream out; |
| 4750 | serialize(net, out); |
| 4751 | const std::string serialized = out.str(); |
| 4752 | std::istringstream in(serialized); |
| 4753 | dlib::deserialize(net2, in); |
| 4754 | |
| 4755 | std::vector<char> buf1; |
| 4756 | dlib::serialize(buf1) << net; |
| 4757 | std::vector<uint8_t> buf2(buf1.begin(), buf1.end()); |
| 4758 | dlib::deserialize(buf2) >> net2; |
| 4759 | } |
| 4760 | |
| 4761 | // ---------------------------------------------------------------------------------------- |
| 4762 |
no test coverage detected