Merge pull request #25884 from PariksheetPinjari909:fixed_warning
PiperOrigin-RevId: 247772570
This commit is contained in:
commit
96d69ba0ee
@ -61,7 +61,7 @@ class CSVDatasetOp : public DatasetOpKernel {
|
|||||||
OP_REQUIRES(ctx, select_cols_tensor->dims() == 1,
|
OP_REQUIRES(ctx, select_cols_tensor->dims() == 1,
|
||||||
errors::InvalidArgument("`select_cols` must be a vector."));
|
errors::InvalidArgument("`select_cols` must be a vector."));
|
||||||
|
|
||||||
int64 buffer_size;
|
int64 buffer_size = 0;
|
||||||
OP_REQUIRES_OK(
|
OP_REQUIRES_OK(
|
||||||
ctx, ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
ctx, ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
||||||
OP_REQUIRES(ctx, buffer_size > 0,
|
OP_REQUIRES(ctx, buffer_size > 0,
|
||||||
|
@ -61,13 +61,13 @@ class MapAndBatchDatasetOp : public UnaryDatasetOpKernel {
|
|||||||
protected:
|
protected:
|
||||||
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
||||||
DatasetBase** output) override {
|
DatasetBase** output) override {
|
||||||
int64 batch_size;
|
int64 batch_size = 0;
|
||||||
OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "batch_size", &batch_size));
|
OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "batch_size", &batch_size));
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(
|
||||||
ctx, batch_size > 0,
|
ctx, batch_size > 0,
|
||||||
errors::InvalidArgument("batch_size must be greater than zero."));
|
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",
|
OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls",
|
||||||
&num_parallel_calls));
|
&num_parallel_calls));
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(
|
||||||
|
@ -72,7 +72,7 @@ class ParseExampleDatasetOp : public UnaryDatasetOpKernel {
|
|||||||
protected:
|
protected:
|
||||||
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
||||||
DatasetBase** output) override {
|
DatasetBase** output) override {
|
||||||
int64 num_parallel_calls;
|
int64 num_parallel_calls = 0;
|
||||||
OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls",
|
OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls",
|
||||||
&num_parallel_calls));
|
&num_parallel_calls));
|
||||||
OP_REQUIRES(ctx, num_parallel_calls > 0,
|
OP_REQUIRES(ctx, num_parallel_calls > 0,
|
||||||
|
@ -267,7 +267,7 @@ class SlidingWindowDatasetOp : public UnaryDatasetOpKernel {
|
|||||||
input_impl_.reset();
|
input_impl_.reset();
|
||||||
}
|
}
|
||||||
// Restore buffer.
|
// Restore buffer.
|
||||||
int64 buffer_size;
|
int64 buffer_size = 0;
|
||||||
TF_RETURN_IF_ERROR(
|
TF_RETURN_IF_ERROR(
|
||||||
reader->ReadScalar(strings::StrCat("buffer_size"), &buffer_size));
|
reader->ReadScalar(strings::StrCat("buffer_size"), &buffer_size));
|
||||||
buffer_.resize(buffer_size);
|
buffer_.resize(buffer_size);
|
||||||
|
@ -77,7 +77,7 @@ class ParallelInterleaveDatasetOp : public UnaryDatasetOpKernel {
|
|||||||
OP_REQUIRES(ctx, block_length > 0,
|
OP_REQUIRES(ctx, block_length > 0,
|
||||||
errors::InvalidArgument("`block_length` must be > 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",
|
OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, "num_parallel_calls",
|
||||||
&num_parallel_calls));
|
&num_parallel_calls));
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(
|
||||||
|
@ -434,7 +434,7 @@ class PrefetchDatasetOp::Dataset : public DatasetBase {
|
|||||||
|
|
||||||
void PrefetchDatasetOp::MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
void PrefetchDatasetOp::MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
||||||
DatasetBase** output) {
|
DatasetBase** output) {
|
||||||
int64 buffer_size;
|
int64 buffer_size = 0;
|
||||||
OP_REQUIRES_OK(ctx,
|
OP_REQUIRES_OK(ctx,
|
||||||
ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
||||||
OP_REQUIRES(ctx,
|
OP_REQUIRES(ctx,
|
||||||
|
@ -364,7 +364,7 @@ class ShuffleDatasetOp : public ShuffleDatasetOpBase {
|
|||||||
|
|
||||||
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
||||||
DatasetBase** output) override {
|
DatasetBase** output) override {
|
||||||
int64 buffer_size;
|
int64 buffer_size = 0;
|
||||||
OP_REQUIRES_OK(
|
OP_REQUIRES_OK(
|
||||||
ctx, ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
ctx, ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(
|
||||||
@ -637,7 +637,7 @@ class ShuffleAndRepeatDatasetOp : public ShuffleDatasetOpBase {
|
|||||||
|
|
||||||
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
void MakeDataset(OpKernelContext* ctx, DatasetBase* input,
|
||||||
DatasetBase** output) override {
|
DatasetBase** output) override {
|
||||||
int64 buffer_size;
|
int64 buffer_size = 0;
|
||||||
OP_REQUIRES_OK(
|
OP_REQUIRES_OK(
|
||||||
ctx, ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
ctx, ParseScalarArgument<int64>(ctx, "buffer_size", &buffer_size));
|
||||||
OP_REQUIRES(
|
OP_REQUIRES(
|
||||||
|
@ -298,7 +298,7 @@ class WindowDatasetOp : public UnaryDatasetOpKernel {
|
|||||||
input_impl_.reset();
|
input_impl_.reset();
|
||||||
}
|
}
|
||||||
// Restore buffer.
|
// Restore buffer.
|
||||||
int64 buffer_size;
|
int64 buffer_size = 0;
|
||||||
TF_RETURN_IF_ERROR(
|
TF_RETURN_IF_ERROR(
|
||||||
reader->ReadScalar(strings::StrCat("buffer_size"), &buffer_size));
|
reader->ReadScalar(strings::StrCat("buffer_size"), &buffer_size));
|
||||||
buffer_.resize(buffer_size);
|
buffer_.resize(buffer_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user