@@ -145,7 +145,7 @@ void ExpandConvBaseLayer::expandFwdOnce(MatrixPtr image,
145145 real *expInData = expandInput_->getData ();
146146 for (int g = 0 ; g < groups_[inIdx]; ++g) {
147147 MatrixPtr A =
148- Matrix::create (wgtData, subK, subM, true , useGpu_); // mark transpose
148+ Matrix::create (wgtData, subM, subK, false , useGpu_); // mark transpose
149149 MatrixPtr B = Matrix::create (expInData, subK, subN, false , useGpu_);
150150 MatrixPtr C = Matrix::create (outData, subM, subN, false , useGpu_);
151151 C->mul (A, B, 1 , 1 );
@@ -182,7 +182,7 @@ void ExpandConvBaseLayer::bpropActs(MatrixPtr out,
182182 // create temporary matrix
183183 MatrixPtr C = Matrix::create (expandInData, subK, subN, false , useGpu_);
184184 MatrixPtr B = Matrix::create (localGradData, subM, subN, false , useGpu_);
185- MatrixPtr A = Matrix::create (wgtData, subK, subM, false , useGpu_);
185+ MatrixPtr A = Matrix::create (wgtData, subM, subK, true , useGpu_);
186186 C->mul (A, B); // mul
187187
188188 // clear the temporary matrix
@@ -247,10 +247,10 @@ void ExpandConvBaseLayer::bpropWeights(MatrixPtr image,
247247
248248 // expand-mul one-group by one
249249 for (int g = 0 ; g < groups_[inpIdx]; g++) {
250- MatrixPtr A = Matrix::create (expandInData, subK, subN, false , useGpu_);
251- MatrixPtr B = Matrix::create (gradData, subM, subN, true , useGpu_);
252- MatrixPtr C = Matrix::create (wGradData, subK, subM , false , useGpu_);
253- C->mul (A, B , 1 , 1 );
250+ MatrixPtr A = Matrix::create (expandInData, subK, subN, true , useGpu_);
251+ MatrixPtr B = Matrix::create (gradData, subM, subN, false , useGpu_);
252+ MatrixPtr C = Matrix::create (wGradData, subM, subK , false , useGpu_);
253+ C->mul (B, A , 1 , 1 );
254254
255255 A->clear ();
256256 B->clear ();
0 commit comments