| 757 | } |
| 758 | |
| 759 | TEST(LSTMOpTest, BlackBoxTestNoCifgNoPeepholeNoProjectionNoClippingReverse) { |
| 760 | const int n_batch = 1; |
| 761 | const int n_input = 2; |
| 762 | // n_cell and n_output have the same size when there is no projection. |
| 763 | const int n_cell = 4; |
| 764 | const int n_output = 4; |
| 765 | const int sequence_length = 3; |
| 766 | |
| 767 | BidirectionalLSTMOpModel lstm( |
| 768 | n_batch, n_input, n_cell, n_output, sequence_length, /*use_cifg=*/false, |
| 769 | /*use_peephole=*/false, /*use_projection_weights=*/false, |
| 770 | /*use_projection_bias=*/false, /*merge_outputs=*/false, |
| 771 | /*use_aux_input=*/false, /*cell_clip=*/0.0, |
| 772 | /*proj_clip=*/0.0, /*quantize_weights=*/false, /*time_major=*/true, |
| 773 | { |
| 774 | {sequence_length, n_batch, n_input}, // input tensor |
| 775 | |
| 776 | // Forward cell |
| 777 | {n_cell, n_input}, // input_to_input_weight tensor |
| 778 | {n_cell, n_input}, // input_to_forget_weight tensor |
| 779 | {n_cell, n_input}, // input_to_cell_weight tensor |
| 780 | {n_cell, n_input}, // input_to_output_weight tensor |
| 781 | |
| 782 | {n_cell, n_output}, // recurrent_to_input_weight tensor |
| 783 | {n_cell, n_output}, // recurrent_to_forget_weight tensor |
| 784 | {n_cell, n_output}, // recurrent_to_cell_weight tensor |
| 785 | {n_cell, n_output}, // recurrent_to_output_weight tensor |
| 786 | |
| 787 | {0}, // cell_to_input_weight tensor |
| 788 | {0}, // cell_to_forget_weight tensor |
| 789 | {0}, // cell_to_output_weight tensor |
| 790 | |
| 791 | {n_cell}, // input_gate_bias tensor |
| 792 | {n_cell}, // forget_gate_bias tensor |
| 793 | {n_cell}, // cell_bias tensor |
| 794 | {n_cell}, // output_gate_bias tensor |
| 795 | |
| 796 | {0, 0}, // projection_weight tensor |
| 797 | {0}, // projection_bias tensor |
| 798 | |
| 799 | // Backward cell |
| 800 | {n_cell, n_input}, // input_to_input_weight tensor |
| 801 | {n_cell, n_input}, // input_to_forget_weight tensor |
| 802 | {n_cell, n_input}, // input_to_cell_weight tensor |
| 803 | {n_cell, n_input}, // input_to_output_weight tensor |
| 804 | |
| 805 | {n_cell, n_output}, // recurrent_to_input_weight tensor |
| 806 | {n_cell, n_output}, // recurrent_to_forget_weight tensor |
| 807 | {n_cell, n_output}, // recurrent_to_cell_weight tensor |
| 808 | {n_cell, n_output}, // recurrent_to_output_weight tensor |
| 809 | |
| 810 | {0}, // cell_to_input_weight tensor |
| 811 | {0}, // cell_to_forget_weight tensor |
| 812 | {0}, // cell_to_output_weight tensor |
| 813 | |
| 814 | {n_cell}, // input_gate_bias tensor |
| 815 | {n_cell}, // forget_gate_bias tensor |
| 816 | {n_cell}, // cell_bias tensor |
nothing calls this directly
no test coverage detected