30CircleNode *CircleCustomGraphBuilder::build_node(
const BuildNodeArgs &bna)
const
32 uint32_t input_count = bna.op.inputs.size();
33 uint32_t output_count = bna.op.outputs.size();
37 for (uint32_t idx = 0; idx < input_count; ++idx)
39 node->
inputs(idx, bna.input_nodes[idx]);
42 const auto opcodes = bna.context->reader()->opcodes();
43 const uint32_t opcode_index = bna.op.opcode_index;
44 const auto opcode = opcodes[opcode_index];
45 assert(opcode !=
nullptr);
48 std::vector<uint8_t>{bna.op.custom_options.begin(), bna.op.custom_options.end()});
49 assert(opcode->custom_code() !=
nullptr);
50 node->custom_code(opcode->custom_code()->c_str());
57CircleNode *CircleCustomGraphBuilder::build_out(
const BuildOutArgs &boa)
const
59 auto *nodeout = boa.node->graph()->nodes()->create<CircleCustomOut>();
61 nodeout->input(boa.node);
62 nodeout->index(boa.index);
NodeContext * nodes(void)
Derived * create(Args &&...args)
bool validate(const ValidateArgs &args) const final
Node * inputs(uint32_t index) const