52 template<
typename dtype>
61 auto returnArray =
exp(inArray).template astype<double>();
62 returnArray /=
static_cast<double>(returnArray.sum().item());
67 auto returnArray =
exp(inArray).template astype<double>();
68 auto expSums = returnArray.sum(inAxis);
70 for (
uint32 row = 0; row < returnArray.shape().rows; ++row)
72 const auto rowExpSum =
static_cast<double>(expSums[row]);
74 [rowExpSum](
double& value) { value /= rowExpSum; });
81 auto returnArray =
exp(inArray.
transpose()).template astype<double>();
82 auto expSums = returnArray.sum(
Axis::COL);
84 for (
uint32 row = 0; row < returnArray.shape().rows; ++row)
86 const auto rowExpSum =
static_cast<double>(expSums[row]);
88 [rowExpSum](
double& value) { value /= rowExpSum; });
91 return returnArray.transpose();