/** * @file tiny_sequential.hpp * @brief Sequential model container for tiny_ai — stacks layers in order * and runs forward/backward through them. */#pragma once#include"tiny_layer.hpp"#ifdef __cplusplus#include<vector>namespacetiny{classSequential{public:Sequential()=default;~Sequential();voidadd(Layer*layer);Tensorforward(constTensor&x);#if TINY_AI_TRAINING_ENABLEDTensorbackward(constTensor&grad_out);voidcollect_params(std::vector<ParamGroup>&groups);#endifvoidsummary()const;voidpredict(constTensor&x,int*labels);floataccuracy(constTensor&x,constint*labels,intn_samples);Layer*operator[](intidx){returnlayers_[idx];}intnum_layers()const{return(int)layers_.size();}protected:std::vector<Layer*>layers_;};}// namespace tiny#endif // __cplusplus