diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..7c67268 Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..187eb87 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/nodes/convtranspose.cc b/src/nodes/convtranspose.cc index eb40b73..671d65d 100644 --- a/src/nodes/convtranspose.cc +++ b/src/nodes/convtranspose.cc @@ -328,9 +328,6 @@ void ConvTranspose::print_calculation( std::ostream &dst) const INDT_4 << "y" << y_idx; dst << " += x" << x_idx; dst << " * w" << w_idx; - // NB: bias is not tested by the ONNX backend tests, but docs are pretty clear here. - if( b ) - dst << " + bias[m]"; dst << ";" << std::endl; // close kernel loop @@ -347,6 +344,32 @@ void ConvTranspose::print_calculation( std::ostream &dst) const // close loops over batches and output channels INDT_1 << "} /* m */" << std::endl; INDT_1 << "} /* b */" << std::endl; + + // NB: bias is not tested by the ONNX backend tests, but docs are pretty clear here. + // YK: bias should be added only once + if( b ) { + // Create the loops over batches and maps (output channels). + INDT_1 << "for( uint32_t b=0; b<" << batch_size << "; b++ ) {" << std::endl; + INDT_2 << "for( uint32_t m=0; m<" << maps << "; m++) {" << std::endl; + for( unsigned i = 0; i