logSoftmax method

Tensor logSoftmax(
  1. int dim
)

Log-softmax over a given dimension.

Implementation

Tensor logSoftmax(int dim) {
  final sm = softmax(dim);
  return sm.map((x) => math.log(x + 1e-10));
}