Download tests/simple_model_test.cpp from cwenzi/neuroflow-cpp: direct link, hf CLI and curl.
- Browser
- Download file 717 Bytes
-
https://huggingface.co/cwenzi/neuroflow-cpp/resolve/main/tests/simple_model_test.cpp
- Command line
-
hf download hf://cwenzi/neuroflow-cpp/tests/simple_model_test.cpp
-
curl -L -o simple_model_test.cpp https://huggingface.co/cwenzi/neuroflow-cpp/resolve/main/tests/simple_model_test.cpp
717 Bytes
| using namespace neuroflow; | |
| int main() { | |
| std::cout << "Simple forward test..." << std::endl; | |
| NeuroFlowModel::Config cfg; | |
| cfg.input_dim = 64; | |
| cfg.hidden_dim = 32; | |
| cfg.output_dim = 5; | |
| cfg.memory_slots = 8; | |
| cfg.memory_dim = 16; | |
| cfg.num_layers = 1; | |
| cfg.num_associations = 2; | |
| cfg.use_mla = false; | |
| NeuroFlowModel model(cfg); | |
| Tensor input({2, cfg.input_dim}); | |
| for (size_t i = 0; i < input.numel(); ++i) input.as_fp32()[i] = 0.1f * i; | |
| std::cout << "Calling forward..." << std::endl; | |
| auto output = model.forward(input); | |
| std::cout << "Success!" << std::endl; | |
| return 0; | |
| } | |