| 1478 | } |
| 1479 | |
| 1480 | size_t CactusGraph::quantize_activations(size_t input) { |
| 1481 | const auto& input_buffer = get_output_buffer(input); |
| 1482 | |
| 1483 | if (input_buffer.precision != Precision::FP16) { |
| 1484 | throw std::invalid_argument("quantize_activations requires FP16 input"); |
| 1485 | } |
| 1486 | |
| 1487 | OpParams params{}; |
| 1488 | params.output_precision = Precision::INT8; |
| 1489 | return add_node(OpType::QUANTIZE_ACTIVATIONS, {input}, input_buffer.shape, params); |
| 1490 | } |
| 1491 | |
| 1492 | size_t CactusGraph::add_node(OpType op_type, const std::vector<size_t>& inputs, const std::vector<size_t>& output_shape, const OpParams& params) { |
| 1493 | auto node = std::make_unique<GraphNode>(next_node_id_, op_type); |
no outgoing calls
no test coverage detected