Free CPU and GPU memory, except the embeddings on CPU */
| 803 | |
| 804 | /** Free CPU and GPU memory, except the embeddings on CPU */ |
| 805 | virtual void clear() { |
| 806 | decltype(moments)().swap(moments); |
| 807 | decltype(head_partitions)().swap(head_partitions); |
| 808 | decltype(tail_partitions)().swap(tail_partitions); |
| 809 | decltype(sample_pools)().swap(sample_pools); |
| 810 | edge_table.clear(); |
| 811 | for (auto &&sampler : samplers) |
| 812 | sampler->clear(); |
| 813 | for (auto &&worker : workers) |
| 814 | worker->clear(); |
| 815 | } |
| 816 | |
| 817 | /** |
| 818 | * @param protocols protocols of embeddings |