def categorical_logpmf(x, logits):
 x = x.astype(np.int32)
 p = (np.exp(logits) / np.sum(np.exp(logits), 0))
 return np.log(p)[x]

def categorical_logpmf ( x , logits ) : x = x . astype ( np . int32 ) p = ( np . exp ( logits ) / np . sum ( np . exp ( logits ) , 0 ) ) return np . log ( p ) [ x ]
parameters x : np .