def log_mean_exp(a):
 max_ = a.max(1)
 return (max_ + T.log(T.exp((a - max_.dimshuffle(0, 'x'))).mean(1)))

def log_mean_exp ( a ) : max_ = a . max ( 1 ) return ( max_ + T . log ( T . exp ( ( a - max_ . dimshuffle ( 0 , 'x' ) ) ) . mean ( 1 ) ) )
compute the log_mean_exp of elements in a tensor .