From d5aaaad1f6727f19ba1ad6f3cd17b28a12ce51f7 Mon Sep 17 00:00:00 2001 From: Pariksheet Date: Tue, 19 Feb 2019 15:05:35 +0530 Subject: [PATCH] Initialize the variables --- tensorflow/core/kernels/data/experimental/csv_dataset_op.cc | 2 +- .../kernels/data/experimental/map_and_batch_dataset_op.cc | 4 ++-- .../kernels/data/experimental/parse_example_dataset_op.cc | 2 +- .../kernels/data/experimental/sliding_window_dataset_op.cc | 2 +- .../core/kernels/data/parallel_interleave_dataset_op.cc | 2 +- tensorflow/core/kernels/data/prefetch_dataset_op.cc | 2 +- tensorflow/core/kernels/data/shuffle_dataset_op.cc | 4 ++-- tensorflow/core/kernels/data/window_dataset_op.cc | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tensorflow/core/kernels/data/experimental/csv_dataset_op.cc b/tensorflow/core/kernels/data/experimental/csv_dataset_op.cc index 4435c2a1313..fecafaacf2d 100644 --- a/tensorflow/core/kernels/data/experimental/csv_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/csv_dataset_op.cc @@ -61,7 +61,7 @@ class CSVDatasetOp : public DatasetOpKernel { OP_REQUIRES(ctx, select_cols_tensor->dims() == 1, errors::InvalidArgument("`select_cols` must be a vector.")); - int64 buffer_size; + int64 buffer_size = 0; OP_REQUIRES_OK( ctx, ParseScalarArgument(ctx, "buffer_size", &buffer_size)); OP_REQUIRES(ctx, buffer_size > 0, diff --git a/tensorflow/core/kernels/data/experimental/map_and_batch_dataset_op.cc b/tensorflow/core/kernels/data/experimental/map_and_batch_dataset_op.cc index 9453f2b1759..ae4e1021067 100644 --- a/tensorflow/core/kernels/data/experimental/map_and_batch_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/map_and_batch_dataset_op.cc @@ -61,13 +61,13 @@ class MapAndBatchDatasetOp : public UnaryDatasetOpKernel { protected: void MakeDataset(OpKernelContext* ctx, DatasetBase* input, DatasetBase** output) override { - int64 batch_size; + int64 batch_size = 0; OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "batch_size", &batch_size)); OP_REQUIRES( ctx, batch_size > 0, errors::InvalidArgument("batch_size must be greater than zero.")); - int64 num_parallel_calls; + int64 num_parallel_calls = 0; OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls", &num_parallel_calls)); OP_REQUIRES( 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 58c621587fe..3dbb4df8ada 100644 --- a/tensorflow/core/kernels/data/experimental/parse_example_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/parse_example_dataset_op.cc @@ -72,7 +72,7 @@ class ParseExampleDatasetOp : public UnaryDatasetOpKernel { protected: void MakeDataset(OpKernelContext* ctx, DatasetBase* input, DatasetBase** output) override { - int64 num_parallel_calls; + int64 num_parallel_calls = 0; OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls", &num_parallel_calls)); OP_REQUIRES(ctx, num_parallel_calls > 0, diff --git a/tensorflow/core/kernels/data/experimental/sliding_window_dataset_op.cc b/tensorflow/core/kernels/data/experimental/sliding_window_dataset_op.cc index c5851eaf86b..dec136dd35e 100644 --- a/tensorflow/core/kernels/data/experimental/sliding_window_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/sliding_window_dataset_op.cc @@ -267,7 +267,7 @@ class SlidingWindowDatasetOp : public UnaryDatasetOpKernel { input_impl_.reset(); } // Restore buffer. - int64 buffer_size; + int64 buffer_size = 0; TF_RETURN_IF_ERROR( reader->ReadScalar(strings::StrCat("buffer_size"), &buffer_size)); buffer_.resize(buffer_size); diff --git a/tensorflow/core/kernels/data/parallel_interleave_dataset_op.cc b/tensorflow/core/kernels/data/parallel_interleave_dataset_op.cc index 666eac3814c..f550888eb52 100644 --- a/tensorflow/core/kernels/data/parallel_interleave_dataset_op.cc +++ b/tensorflow/core/kernels/data/parallel_interleave_dataset_op.cc @@ -75,7 +75,7 @@ class ParallelInterleaveDatasetOp : public UnaryDatasetOpKernel { OP_REQUIRES(ctx, block_length > 0, errors::InvalidArgument("`block_length` must be > 0")); - int64 num_parallel_calls; + int64 num_parallel_calls = 0; OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls", &num_parallel_calls)); OP_REQUIRES( diff --git a/tensorflow/core/kernels/data/prefetch_dataset_op.cc b/tensorflow/core/kernels/data/prefetch_dataset_op.cc index eeb6d3005bd..59df04f7b42 100644 --- a/tensorflow/core/kernels/data/prefetch_dataset_op.cc +++ b/tensorflow/core/kernels/data/prefetch_dataset_op.cc @@ -382,7 +382,7 @@ class PrefetchDatasetOp::Dataset : public DatasetBase { void PrefetchDatasetOp::MakeDataset(OpKernelContext* ctx, DatasetBase* input, DatasetBase** output) { - int64 buffer_size; + int64 buffer_size = 0; OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "buffer_size", &buffer_size)); OP_REQUIRES(ctx, diff --git a/tensorflow/core/kernels/data/shuffle_dataset_op.cc b/tensorflow/core/kernels/data/shuffle_dataset_op.cc index 287a7c946c0..add526704f8 100644 --- a/tensorflow/core/kernels/data/shuffle_dataset_op.cc +++ b/tensorflow/core/kernels/data/shuffle_dataset_op.cc @@ -364,7 +364,7 @@ class ShuffleDatasetOp : public ShuffleDatasetOpBase { void MakeDataset(OpKernelContext* ctx, DatasetBase* input, DatasetBase** output) override { - int64 buffer_size; + int64 buffer_size = 0; OP_REQUIRES_OK( ctx, ParseScalarArgument(ctx, "buffer_size", &buffer_size)); OP_REQUIRES( @@ -637,7 +637,7 @@ class ShuffleAndRepeatDatasetOp : public ShuffleDatasetOpBase { void MakeDataset(OpKernelContext* ctx, DatasetBase* input, DatasetBase** output) override { - int64 buffer_size; + int64 buffer_size = 0; OP_REQUIRES_OK( ctx, ParseScalarArgument(ctx, "buffer_size", &buffer_size)); OP_REQUIRES( diff --git a/tensorflow/core/kernels/data/window_dataset_op.cc b/tensorflow/core/kernels/data/window_dataset_op.cc index 150385c96ca..bfe2ef35280 100644 --- a/tensorflow/core/kernels/data/window_dataset_op.cc +++ b/tensorflow/core/kernels/data/window_dataset_op.cc @@ -298,7 +298,7 @@ class WindowDatasetOp : public UnaryDatasetOpKernel { input_impl_.reset(); } // Restore buffer. - int64 buffer_size; + int64 buffer_size = 0; TF_RETURN_IF_ERROR( reader->ReadScalar(strings::StrCat("buffer_size"), &buffer_size)); buffer_.resize(buffer_size);