From c759a9fb3917a7c2c194cf83403ccc4936d2f3b9 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 20 Jun 2019 12:49:57 -0700 Subject: [PATCH] Allow AUTOTUNE to be an acceptable value for num_parallel_calls. PiperOrigin-RevId: 254252931 --- .../kernels/data/experimental/parse_example_dataset_op.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tensorflow/core/kernels/data/experimental/parse_example_dataset_op.cc b/tensorflow/core/kernels/data/experimental/parse_example_dataset_op.cc index 6eace17c7e4..151f6fd474b 100644 --- a/tensorflow/core/kernels/data/experimental/parse_example_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/parse_example_dataset_op.cc @@ -75,9 +75,10 @@ class ParseExampleDatasetOp : public UnaryDatasetOpKernel { int64 num_parallel_calls = 0; OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls", &num_parallel_calls)); - OP_REQUIRES(ctx, num_parallel_calls > 0, - errors::InvalidArgument( - "num_parallel_calls must be greater than zero.")); + OP_REQUIRES( + ctx, num_parallel_calls > 0 || num_parallel_calls == model::kAutoTune, + errors::InvalidArgument( + "num_parallel_calls must be greater than zero.")); OpInputList dense_default_tensors; OP_REQUIRES_OK(ctx,