diff --git a/source/core/Pipeline.cpp b/source/core/Pipeline.cpp index 8c83307f..fad7680d 100644 --- a/source/core/Pipeline.cpp +++ b/source/core/Pipeline.cpp @@ -87,7 +87,6 @@ Pipeline::Unit::Unit(const Op* op, const std::vector& inputs, const std if (nullptr != typeStr) { mContent->type = typeStr; } - mComputer = SizeComputerSuite::get()->search(mType); } @@ -178,6 +177,11 @@ ErrorCode Pipeline::Unit::prepare(Backend* bn, Backend* cpuBn) { if (o->size() <= 0) { ready = false; } + if (o->dimensions() < 4 && TensorUtils::getDescribe(o)->dimensionFormat == MNN_DATA_FORMAT_NC4HW4) { + for (auto index = o->dimensions(); index < 4; ++index) { + o->setLength(index, 1); + } + } } mContent->flops = SizeComputer::computeFlops(mOriginOp, mInputs, mOutputs); diff --git a/source/core/Pipeline.hpp b/source/core/Pipeline.hpp index 10c8718b..f36d8a6b 100644 --- a/source/core/Pipeline.hpp +++ b/source/core/Pipeline.hpp @@ -102,7 +102,6 @@ public: private: bool mConst = false; - const SizeComputer* mComputer = nullptr; }; protected: