51 template<
typename dtype>
60 auto returnArray =
exp(inArray).template astype<double>();
61 returnArray /=
static_cast<double>(returnArray.sum().item());
66 auto returnArray =
exp(inArray).template astype<double>();
67 auto expSums = returnArray.sum(inAxis);
69 for (
uint32 row = 0; row < returnArray.shape().rows; ++row)
71 const auto rowExpSum =
static_cast<double>(expSums[row]);
73 [rowExpSum](
double& value) { value /= rowExpSum; });
80 auto returnArray =
exp(inArray.
transpose()).template astype<double>();
81 auto expSums = returnArray.sum(
Axis::COL);
83 for (
uint32 row = 0; row < returnArray.shape().rows; ++row)
85 const auto rowExpSum =
static_cast<double>(expSums[row]);
87 [rowExpSum](
double& value) { value /= rowExpSum; });
90 return returnArray.transpose();