def __init__(self, num_layers, input_dim, hidden_dim, model, rnn_builder_factory):
assert num_layers > <NUM_LIT:0><EOL>assert hidden_dim % <NUM_LIT:2> == <NUM_LIT:0><EOL>self.builder_layers = []<EOL>f = rnn_builder_factory(<NUM_LIT:1>, input_dim, hidden_dim/<NUM_LIT:2>, model)<EOL>b = rnn_builder_factory(<NUM_LIT:1>, input_dim, hidden_dim/<NUM_LIT:2>, model)<EOL>self.builder_layers.append((f,b))<EOL>for _ in xrange(num_layers-<NUM_LIT:1>):<EOL><INDENT>f = rnn_builder_factory(<NUM_LIT:1>, hidden_dim, hidden_dim/<NUM_LIT:2>, model)<EOL>b = rnn_builder_factory(<NUM_LIT:1>, hidden_dim, hidden_dim/<NUM_LIT:2>, model)<EOL>self.builder_layers.append((f,b))<EOL><DEDENT>
@param num_layers: depth of the BiRNN
@param input_dim: size of the inputs
@param hidden_dim: size of the outputs (and intermediate layer representations)
@param model
@param rnn_builder_factory: RNNBuilder subclass, e.g. LSTMBuilder