void softmax(float input[], float softmax_output[], int c, int h, int w){
float sum = 0.0f;
int cc, hw;
int chPitch = h * w;
for (hw = 0; hw < chPitch; hw++){
sum = 0.0f;
for (cc = 0; cc < c; cc++){
softmax_output[chPitch*cc + hw] = expf(input[chPitch*cc + hw]);
sum += softmax_output[chPitch*cc + hw];
}
for (cc = 0; cc < c; cc++){
softmax_output[chPitch*cc + hw] /= (sum + 1e-6);
}
}
return;
}