MCPcopy Create free account
hub / github.com/alibaba/MNN / _Interp

Function _Interp

express/NeuralNetWorkOp.cpp:1481–1500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1479}
1480
1481VARP _Interp(VARPS xs, float widthScale, float heightScale, int outputWidth, int outputHeight, int resizeType, bool alignCorners) {
1482 std::unique_ptr<OpT> interp(new OpT);
1483 interp->type = OpType_Interp;
1484 auto param = new InterpT;
1485 param->widthScale = widthScale;
1486 param->heightScale = heightScale;
1487 param->outputWidth = outputWidth;
1488 param->outputHeight = outputHeight;
1489 param->resizeType = resizeType;
1490 param->alignCorners = alignCorners;
1491 if ((resizeType == 2 || resizeType == 3) && alignCorners) {
1492 param->ctm = MNN::CoordinateTransformationMode_AlignCorners;
1493 }
1494 if ((resizeType == 2 || resizeType == 3) && !alignCorners) {
1495 param->ctm = MNN::CoordinateTransformationMode_PytorchHalfPixels;
1496 }
1497 interp->main.value = param;
1498 interp->main.type = OpParameter_Interp;
1499 return Variable::create(Expr::create(std::move(interp), xs));
1500}
1501VARP _ZeroGrad(VARP x) {
1502 std::unique_ptr<OpT> op(new OpT);
1503 op->type = OpType_ZeroGrad;

Callers 7

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls 1

createFunction · 0.50

Tested by 6

runMethod · 0.68
runMethod · 0.68
runMethod · 0.68
runMethod · 0.68
runMethod · 0.68
runMethod · 0.68