aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/kernels/internal
diff options
context:
space:
mode:
authorGravatar Jared Duke <jdduke@google.com>2018-09-12 08:42:02 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-12 08:49:55 -0700
commit6995d2b9be0e398f11a17348eb5b4745aee0af0d (patch)
tree174a2f4074a50ef8d5010687ffc4182124016258 /tensorflow/contrib/lite/kernels/internal
parent9333978b4b08e4b3fdc7f63ec0873a7e00dcc4b7 (diff)
Fix convolution bug when input and filter dimensions match
TFLite has an optimized matmul path for cases where the input and filter tensors have matching width+height. However, this case doesn't properly account for multiple *batches*. Account for this and add an appropriate test. Credit to zgxnet for the bug and proposed fix. Fixes #21817 PiperOrigin-RevId: 212645329
Diffstat (limited to 'tensorflow/contrib/lite/kernels/internal')
-rw-r--r--tensorflow/contrib/lite/kernels/internal/optimized/multithreaded_conv.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/contrib/lite/kernels/internal/optimized/multithreaded_conv.h b/tensorflow/contrib/lite/kernels/internal/optimized/multithreaded_conv.h
index 5fb31889fe..59f0e3c927 100644
--- a/tensorflow/contrib/lite/kernels/internal/optimized/multithreaded_conv.h
+++ b/tensorflow/contrib/lite/kernels/internal/optimized/multithreaded_conv.h
@@ -113,8 +113,8 @@ class EigenTensorConvFunctor {
filter_width * filter_height * input_depth;
Eigen::array<Eigen::IndexPair<Eigen::DenseIndex>, 1> dim_pair;
dim_pair[0] = Eigen::IndexPair<Eigen::DenseIndex>(1, 0);
- EigenMatrix output(output_data, 1, filter_count);
- ConstEigenMatrix input(input_data, 1, k);
+ EigenMatrix output(output_data, input_batches, filter_count);
+ ConstEigenMatrix input(input_data, input_batches, k);
ConstEigenMatrix filter(filter_data, k, filter_count);
MatMulConvFunctor<Eigen::ThreadPoolDevice, T>()(device, output, input,
filter, dim_pair);