// TODO Check data layout
return true;
}
+
+ bool visit(const coco::PadF *) override
+ {
+ // TODO Check data layout
+ return true;
+ }
};
return ins->accept(CompatibilityCheck{}) ? COMPATIBLE : INCOMPATIBLE;
{ifm, left, right, top, bottom, hstride, vstride, width, height, fuse},
{ofm});
}
+ else if (auto op = unit->op()->asPadF())
+ {
+ using nncc::core::ADT::tensor::Shape;
+
+ auto ifm = _binder->addOperand<float>(unit->ifm());
+ auto pad = _binder->addOperand<int32_t>(Shape{4, 2});
+ {
+ std::vector<int32_t> values;
+ values.resize(8);
+ // For 'N'
+ values.at(0) = values.at(1) = 0;
+ // For 'H'
+ values.at(2) = op->pad()->top();
+ values.at(3) = op->pad()->bottom();
+ // For 'W'
+ values.at(4) = op->pad()->left();
+ values.at(5) = op->pad()->right();
+ // For 'C'
+ values.at(6) = values.at(7) = 0;
+
+ _binder->setOperand(pad, values.begin(), values.end());
+ }
+
+ auto ofm = _binder->addOperand<float>(unit->ofm());
+
+ _binder->addOperation(ann::Operation::Code::PAD, {ifm, pad}, {ofm});
+ }
else
{
throw std::runtime_error{"Not supported, yet"};