def bound(logp, *conditions, **kwargs):
 broadcast_conditions = kwargs.get('broadcast_conditions', True)
 if broadcast_conditions:
  alltrue = alltrue_elemwise
 else:
  alltrue = alltrue_scalar
 return tt.switch(alltrue(conditions), logp, (- np.inf))

def bound ( logp , * conditions , ** kwargs ) : broadcast_conditions = kwargs . get ( 'broadcast_conditions' , True ) if broadcast_conditions : alltrue = alltrue_elemwise else : alltrue = alltrue_scalar return tt . switch ( alltrue ( conditions ) , logp , ( - np . inf ) )
bounds a log probability density with several conditions .