17 static const unsigned n_in = 10;
18 static const unsigned n_out = 10;
28 template <
class x_T,
class y_T>
32 template <
class data_T,
class res_T,
typename CONFIG_T>
34 res_T
res[CONFIG_T::n_out],
35 typename CONFIG_T::weight_t
weights[CONFIG_T::n_in * CONFIG_T::n_out],
36 typename CONFIG_T::bias_t biases[CONFIG_T::n_out]) {
38 typename CONFIG_T::accum_t
mult[CONFIG_T::n_in * CONFIG_T::n_out];
39 typename CONFIG_T::accum_t acc[CONFIG_T::n_out];
42 for (
unsigned ii = 0;
ii < CONFIG_T::n_in;
ii++) {
44 for (
unsigned jj = 0;
jj < CONFIG_T::n_out;
jj++) {
45 unsigned index =
ii * CONFIG_T::n_out +
jj;
51 for (
unsigned iacc = 0; iacc < CONFIG_T::n_out; iacc++) {
52 acc[iacc] = (
typename CONFIG_T::accum_t)biases[iacc];
56 for (
unsigned ii = 0;
ii < CONFIG_T::n_in;
ii++) {
57 for (
unsigned jj = 0;
jj < CONFIG_T::n_out;
jj++) {
58 unsigned index =
ii * CONFIG_T::n_out +
jj;
64 for (
unsigned ires = 0; ires < CONFIG_T::n_out; ires++) {
66 res[ires] = cast<data_T, res_T, CONFIG_T>(acc[ires]);
static const bool store_weights_in_bram
void dense(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_out], typename CONFIG_T::weight_t weights[CONFIG_T::n_in *CONFIG_T::n_out], typename CONFIG_T::bias_t biases[CONFIG_T::n_out])
static const unsigned n_out
def template(fileName, svg, replaceme="REPLACEME")
char data[epos_bytes_allocation]
static const unsigned n_in