cwenzi/neuroflow-cpp-bucket / tests /full_forward_test.cpp
cwenzi's picture
download
raw
1.11 kB
#include <iostream>
#include <exception>
#include "../include/neuroflow/model.hpp"
using namespace neuroflow;
int main() {
try {
std::cout << "Full 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 full forward..." << std::endl;
auto output = model.forward(input, nullptr, false, false);
std::cout << "Output shape: [" << output.output.shape_[0] << ", " << output.output.shape_[1] << "]" << std::endl;
std::cout << "Success!" << std::endl;
return 0;
} catch (const std::exception& e) {
std::cout << "Error: " << e.what() << std::endl;
return 1;
}
}

Xet Storage Details

Size:
1.11 kB
·
Xet hash:
f2e97a950d01563aeeea82650270c1e4b4c87c184702823e40321a7fd4f4324f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.