mirror of https://github.com/alibaba/MNN.git
[MNN:Bugfix] Fix bug for NC4HW4 with least than 4 dimenstion
This commit is contained in:
parent
e93e8dcbe8
commit
ac84e1190a
|
|
@ -87,7 +87,6 @@ Pipeline::Unit::Unit(const Op* op, const std::vector<Tensor*>& 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ public:
|
|||
|
||||
private:
|
||||
bool mConst = false;
|
||||
const SizeComputer* mComputer = nullptr;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Reference in New Issue