/// Creates a PadNode with the given \p name and output type \p outTy which
/// pads the given \p input with the explicit pads \p pads according to the
/// padding mode \p mode and with the given value \p value. The padding mode
/// \p mode is one of enumeration values from \ref PaddingMode. For an input
/// with N dimensions (rank N) the \p pads must be a vector with 2*N values
/// with the following format:
/// pads = [pad_before(D1), pad_before(D2), …, pad_before(DN),
/// pad_after (D1), pad_after (D2), …, pad_after (DN)].
/// The mode PaddingMode::CONSTANT pads the input using the constant value
/// \p value and currently is the only mode supported.
PadNode *createPad(llvm::StringRef name, NodeValue input, TypeRef outTy,
unsigned_t mode, llvm::ArrayRef<int> pads, float value);
I am trying to pad a placeholder node that is of dimensions (NHWC) 16X5X5X1 to 16X5X5X4
I am able to create a PadNode and add it to the graph(I crosschecked it by dumping the DAG), but I am hitting a segmentation fault while generating IR.
Am I passing the correct values to /p pads parameter?
int pads[] = {0, 0, 0, 0, 0, 0, 0, 3};
auto filterOutTy = F->getParent()->uniqueType(ElemKind::FloatTy, filterOutPadDims);
auto inputOutTy = F->getParent()->uniqueType(ElemKind::FloatTy, inputOutPadDims);
auto *INPUTPAD = F->createPad("pad", nodeValue0, inputOutTy, PaddingMode::CONSTANT, pads, 0.f);