Skip to content

Commit

Permalink
Fix bug for InterpGradTest
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaying committed Dec 30, 2022
1 parent 57f91e5 commit 5dc39a5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions express/NeuralNetWorkOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,11 +1488,6 @@ std::vector<VARP> _DetectionPostProcess(VARP encode_boxes, VARP class_prediction
}

VARP _Interp(VARPS xs, float widthScale, float heightScale, int outputWidth, int outputHeight, int resizeType, bool alignCorners) {
if (xs.size() == 1) {
float scales[] = {1.0, 1.0, heightScale, widthScale};
auto scaleVar = _Const((void*)scales, {4}, NCHW);
xs.push_back(scaleVar);
}
std::unique_ptr<OpT> interp(new OpT);
interp->type = OpType_Interp;
auto param = new InterpT;
Expand Down
2 changes: 1 addition & 1 deletion test/grad/InterpGradTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class InterpGradTest : public MNNTestCase {
auto opExpr = output->expr().first;
auto grad = OpGrad::get(opExpr->get()->type());

float outputDiff[len2] = { 0.4334, 0.0341, 0.2641, 0.7900, 0.5033, 0.5753, 0.0180, 0.7617, 0.3299,
float outputDiff[] = { 0.4334, 0.0341, 0.2641, 0.7900, 0.5033, 0.5753, 0.0180, 0.7617, 0.3299,
0.9388, 0.7645, 0.9430, 0.7312, 0.1058, 0.4154, 0.7537, 0.3959, 0.2058,
0.9084, 0.9178, 0.6203, 0.3946, 0.5286, 0.0053, 0.5959, 0.4805, 0.3953,
0.8146, 0.8543, 0.1426, 0.4022, 0.8199, 0.7822, 0.3160, 0.5057, 0.8435,
Expand Down

0 comments on commit 5dc39a5

Please sign in to comment.