Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions kernels/optimized/cpu/op_log_softmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void log_softmax_kernel(const Tensor& input, int64_t dim, Tensor& out) {
template <typename OUT_T>
bool log_softmax_wrapper(const Tensor& X, int64_t dim, Tensor& out) {
if constexpr (
std::is_same_v<OUT_T, double> ||
std::is_same_v<OUT_T, executorch::aten::BFloat16> ||
std::is_same_v<OUT_T, executorch::aten::Half>) {
// Input dtype equals output dtype (enforced by check_log_softmax_args).
Expand All @@ -112,7 +113,6 @@ bool log_softmax_wrapper(const Tensor& X, int64_t dim, Tensor& out) {
} else {
auto input_scalar_type = X.scalar_type();
switch (input_scalar_type) {
// TODO: support Double as well
case ScalarType::Float:
log_softmax_kernel<float, OUT_T>(X, dim, out);
return true;
Expand Down Expand Up @@ -149,12 +149,16 @@ Tensor& opt_log_softmax_out(

auto out_scalar_type = out.scalar_type();
switch (out_scalar_type) {
// TODO: support Double as well
case ScalarType::Float: {
bool success = log_softmax_wrapper<float>(self, dim, out);
ET_KERNEL_CHECK(context, success, InvalidArgument, out);
break;
}
case ScalarType::Double: {
bool success = log_softmax_wrapper<double>(self, dim, out);
ET_KERNEL_CHECK(context, success, InvalidArgument, out);
break;
}
case ScalarType::BFloat16: {
bool success =
log_softmax_wrapper<executorch::aten::BFloat16>(self, dim, out);
Expand Down
3 changes: 0 additions & 3 deletions kernels/optimized/test/supported_features_def.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
- namespace: op_gelu
dtype_double: false

- namespace: op_log_softmax
dtype_double: false
Loading