Skip to content
Snippets Groups Projects
Commit 334dcbd2 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Add first template for saving outputs (need to include it properly in forwards call ...

parent 95630153
No related branches found
No related tags found
3 merge requests!17v0.1.0,!12v0.4.0,!11Export refactor
{% for outidx in range(nb_out) -%}
{%if out_dims[outidx]|length == 4 %}
printf("{{ out_name[outidx] }} (NCHW format):\r\n");
int N_{{ out_name[outidx] }} = {{ out_dims[outidx][0] }};
int C_{{ out_name[outidx] }} = {{ out_dims[outidx][1] }};
int H_{{ out_name[outidx] }} = {{ out_dims[outidx][2] }};
int W_{{ out_name[outidx] }} = {{ out_dims[outidx][3] }};
for (int n = 0; n < N_{{ out_name[outidx] }}; ++n) {
for (int c = 0; c < C_{{ out_name[outidx] }}; ++c) {
printf("Batch %d, Channel %d:\r\n", n, c);
for (int h = 0; h < H_{{ out_name[outidx] }}; ++h) {
for (int w = 0; w < W_{{ out_name[outidx] }}; ++w) {
printf("%f ", {{ out_name[outidx] }}[n * H_{{ out_name[outidx] }} * W_{{ out_name[outidx] }} * C_{{ out_name[outidx] }} + h * W_{{ out_name[outidx] }} * C_{{ out_name[outidx] }} + w * C_{{ out_name[outidx] }} + c]);
}
printf("\r\n");
}
printf("\r\n");
}
}
printf("\r\n");
{% else %}
printf("{{ out_name[outidx] }}:\r\n");
for (int o = 0; o < {{ out_size[outidx] }}; ++o) {
printf("%f ", {{ out_name[outidx] }}[o]);
}
printf("\r\n");
{% endif %}
printf("\r\n");
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment