/// Creates a PadNode with the given \p name and output type \p outTy which
/// 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:
/// \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};


I think it looks reasonable, though I don’t see what inputOutPadDims is. Have you tried running in assert mode, to see if it hits an assertion instead of seg faulting? Or have you tried running in a debugger to see where the seg fault is?