def get_numpy_prediction_gru(
            X,
            H,
            return_seq,
            direction,
            inner_activation_str="sigmoid",
            activation_str="tanh",
        ):
            """
            shape of X : (B, Seq, input_size)

            shape of H : (B, hidden_size)

            shape of return = (B, 1, hidden_size) if return_seq=False else (B, Seq, hidden_size)
            """
            assert X.shape == (batch_size, seq_len, input_size)
            assert H.shape == (batch_size, hidden_size)
            out = []
            for i in range(batch_size):
                numpy_input = X[i]
                hidden_state = H[i]
                out.append(
                    get_numpy_prediction_gru_single_batch(
                        numpy_input,
                        hidden_state,
                        return_seq,
                        direction,
                        inner_activation_str=inner_activation_str,
                        activation_str=activation_str,
                    )
                )
            output = np.stack(out, axis=0)
            output = np.transpose(output, (1, 0, 2))
            return output, output[-1, :, :]

            shape of X : (B, Seq, input_size)

            shape of H : (B, hidden_size)

            shape of return = (B, 1, hidden_size) if return_seq=False else (B, Seq, hidden_size)
            
coremltools/converters/mil/mil/ops/tests/iOS14/test_recurrent.py