def build_encoder_w2v(tparams, options):
 opt_ret = dict()
 trng = RandomStreams(1234)
 embedding = tensor.tensor3('embedding', dtype='float32')
 x_mask = tensor.matrix('x_mask', dtype='float32')
 proj = get_layer(options['encoder'])[1](tparams, embedding, None, options, prefix='encoder', mask=x_mask)
 ctx = proj[0][(-1)]
 return (trng, embedding, x_mask, ctx)

def build_encoder_w2v ( tparams , options ) : opt_ret = dict ( ) trng = RandomStreams ( 1234 ) embedding = tensor . tensor3 ( 'embedding' , dtype = 'float32' ) x_mask = tensor . matrix ( 'x_mask' , dtype = 'float32' ) proj = get_layer ( options [ 'encoder' ] ) [ 1 ] ( tparams , embedding , None , options , prefix = 'encoder' , mask = x_mask ) ctx = proj [ 0 ] [ ( - 1 ) ] return ( trng , embedding , x_mask , ctx )
computation graph for encoder .