30 std::vector<mir::Operation::Output *> inputs = context->
getNodeInputs(onnx_node);
33 assert(inputs.size() == 1);
34 auto input = inputs[0];
37 const auto value = getAttributeValue<float>(onnx_node,
"value", 0.0f);
38 const auto pads = getAttributeValue<std::vector<std::int64_t>>(onnx_node, pad_attr_name);
40 const auto mode = getAttributeValue<std::string>(onnx_node,
"mode",
"constant");
41 if (mode !=
"constant")
42 throw std::runtime_error(
"Not supported Pad mode attribute!");
44 const int num_dims = input->getShape().rank();
45 assert(
static_cast<int>(pads.size()) == num_dims * 2);
47 for (
int i = 0; i < num_dims; i++)
55 auto result = createOp<mir::ops::PadOp>(graph, input, attributes)->getOutput(0);
void setNodeOutputs(const onnx::NodeProto &onnx_node, const std::vector< mir::Operation::Output * > &outputs)
std::vector< mir::Operation::Output * > getNodeInputs(const onnx::NodeProto &onnx_node) const
mir::Graph * getGraph() const