Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix a check fail in Fast Fourier implementation
PiperOrigin-RevId: 372026629
Change-Id: Id05c3362aa575271bc3e06b16316c9037085fc11
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed May 5, 2021
1 parent 8926cbd commit 1c56f53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/kernels/fft_ops.cc
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include "tensorflow/core/platform/errors.h"
#define EIGEN_USE_THREADS

// See docs in ../ops/fft_ops.cc.
Expand Down Expand Up @@ -261,6 +262,9 @@ class FFTCPU : public FFTBase {
i == FFTRank ? fft_shape[i - 1] / 2 + 1 : fft_shape[i - 1];
full_fft_shape.AddDim(fft_shape[i - 1]);
}
OP_REQUIRES(ctx, full_fft_shape.num_elements() > 0,
errors::InvalidArgument("Obtained a FFT shape of 0 elements: ",
full_fft_shape.DebugString()));

Tensor temp;
OP_REQUIRES_OK(ctx, ctx->allocate_temp(DataTypeToEnum<ComplexT>::v(),
Expand Down

0 comments on commit 1c56f53

Please sign in to comment.