def softmax(x):
    if x.ndim == 2:
        e = TT.exp(x)
        return e / TT.sum(e, axis=1).dimshuffle(0, 'x')
    else:
        e = TT.exp(x)
        return e/ TT.sum(e)
dataset/ETHPy150Open pascanur/GroundHog/groundhog/utils/utils.py/softmax/original