| 674 | } |
| 675 | |
| 676 | void CLLSTMLayerQuantized::run() |
| 677 | { |
| 678 | prepare(); |
| 679 | |
| 680 | // Acquire all the temporaries |
| 681 | MemoryGroupResourceScope scope_mg(_memory_group); |
| 682 | |
| 683 | // Concat and transpose the input |
| 684 | _concat_inputs.run(); |
| 685 | |
| 686 | // Run gemmlowp |
| 687 | _gemmlowp.run(); |
| 688 | _output_stage.run(); |
| 689 | |
| 690 | // Slice the results |
| 691 | _slice_input_tensor.run(); |
| 692 | _slice_forget_tensor.run(); |
| 693 | _slice_cell_tensor.run(); |
| 694 | _slice_output_tensor.run(); |
| 695 | |
| 696 | // Gates |
| 697 | // Forget gate |
| 698 | _sigmoid_forget_gate.run(); |
| 699 | |
| 700 | // Input gate |
| 701 | _sigmoid_input_gate.run(); |
| 702 | |
| 703 | // Input modulation gate |
| 704 | _tanh_modulation_gate.run(); |
| 705 | |
| 706 | // Output gate |
| 707 | _sigmoid_output_gate.run(); |
| 708 | |
| 709 | // Cell state (long term memory) |
| 710 | _mul_forget_gate_cell_state.run(); |
| 711 | _mul_input_gate_input_mod_gate.run(); |
| 712 | _add_cell_state_tmps.run(); |
| 713 | |
| 714 | // Output state (short term memory) |
| 715 | _tanh_output_state.run(); |
| 716 | _mul_output_state_tmp_output_gate.run(); |
| 717 | |
| 718 | // Requantize output state from QSYMM16 to QASYMM8 |
| 719 | _dequantize.run(); |
| 720 | _quantize.run(); |
| 721 | } |
| 722 | |
| 723 | void CLLSTMLayerQuantized::prepare() |
| 724 | { |