diff --git a/tensorflow/core/kernels/scatter_functor.h b/tensorflow/core/kernels/scatter_functor.h index 5cce0f455a0..3c3a86d4cb8 100644 --- a/tensorflow/core/kernels/scatter_functor.h +++ b/tensorflow/core/kernels/scatter_functor.h @@ -264,6 +264,12 @@ struct ScatterFunctorBase { typename TTypes::Matrix params, typename TTypes::ConstMatrix updates, typename TTypes::ConstFlat indices) { +#ifdef PLATFORM_GOOGLE + // The parallel version is significantly slower internally. Only call the + // serial version for now. + // TODO(penporn): Avoid locking in parallelization (sort beforehand). + return SerialExecute(c, d, params, updates, indices); +#else // indices and params sizes were validated in DoCompute(). const Index N = static_cast(indices.size()); const Index limit = static_cast(params.dimension(0)); @@ -282,6 +288,7 @@ struct ScatterFunctorBase { return SerialExecute(c, d, params, updates, indices); else return ParallelExecute(c, d, params, updates, indices); +#endif // PLATFORM_GOOGLE } };