CoolFace
Modelpublic

cwenzi/neuroflow-cpp

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
1likes
full_forward_test.cpp37 linesDownload Raw Back to tests
1#include <iostream>2#include <exception>3#include "../include/neuroflow/model.hpp"4 5using namespace neuroflow;6 7int main() {8    try {9        std::cout << "Full forward test..." << std::endl;10        11        NeuroFlowModel::Config cfg;12        cfg.input_dim = 64;13        cfg.hidden_dim = 32;14        cfg.output_dim = 5;15        cfg.memory_slots = 8;16        cfg.memory_dim = 16;17        cfg.num_layers = 1;18        cfg.num_associations = 2;19        cfg.use_mla = false;20        21        NeuroFlowModel model(cfg);22        23        Tensor input({2, cfg.input_dim});24        for (size_t i = 0; i < input.numel(); ++i) input.as_fp32()[i] = 0.1f * i;25        26        std::cout << "Calling full forward..." << std::endl;27        auto output = model.forward(input, nullptr, false, false);28        29        std::cout << "Output shape: [" << output.output.shape_[0] << ", " << output.output.shape_[1] << "]" << std::endl;30        std::cout << "Success!" << std::endl;31        return 0;32    } catch (const std::exception& e) {33        std::cout << "Error: " << e.what() << std::endl;34        return 1;35    }36}37