def gamma_entropy_vec(a, scale):
 if isinstance(scale, float):
  return stats.gamma.entropy(a, scale=scale)
 else:
  return np.array([stats.gamma.entropy(a_x, scale=scale_x) for (a_x, scale_x) in zip(a, scale)])

def gamma_entropy_vec ( a , scale ) : if isinstance ( scale , float ) : return stats . gamma . entropy ( a , scale = scale ) else : return np . array ( [ stats . gamma . entropy ( a_x , scale = scale_x ) for ( a_x , scale_x ) in zip ( a , scale ) ] )
vectorized version of stats .