aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-10-03 16:52:30 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-03 17:06:11 -0700
commit3a9a3664fe1aa9e5c81ca4959f028c2a8161520e (patch)
tree42c146c085a78cfc2e60230abc6a53a352f7125b /tensorflow/contrib
parentcaaf9a89750a9a0b3d66f3ce3e9bd507f4c6514c (diff)
Fix 1970s-style bug in LogSoftmax eval.
PiperOrigin-RevId: 215653797
Diffstat (limited to 'tensorflow/contrib')
-rw-r--r--tensorflow/contrib/lite/kernels/activations.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/contrib/lite/kernels/activations.cc b/tensorflow/contrib/lite/kernels/activations.cc
index cf9441aee3..9aed4f09b8 100644
--- a/tensorflow/contrib/lite/kernels/activations.cc
+++ b/tensorflow/contrib/lite/kernels/activations.cc
@@ -616,13 +616,15 @@ TfLiteStatus LogSoftmaxEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
switch (input->type) {
- case kTfLiteFloat32:
+ case kTfLiteFloat32: {
SoftmaxParams op_params;
optimized_ops::LogSoftmax(
op_params, GetTensorShape(input), GetTensorData<float>(input),
GetTensorShape(output), GetTensorData<float>(output));
return kTfLiteOk;
- case kTfLiteUInt8:
+ }
+ case kTfLiteUInt8: {
+ SoftmaxParams op_params;
op_params.input_multiplier = data->input_multiplier;
op_params.input_left_shift = data->input_left_shift;
op_params.reverse_scaling_divisor = data->reverse_scaling_divisor;
@@ -632,6 +634,7 @@ TfLiteStatus LogSoftmaxEval(TfLiteContext* context, TfLiteNode* node) {
op_params, GetTensorShape(input), GetTensorData<uint8_t>(input),
GetTensorShape(output), GetTensorData<uint8_t>(output));
return kTfLiteOk;
+ }
default:
context->ReportError(context, "Only float32 supported currently., got %d",
input->type);