diff options
Diffstat (limited to 'tensorflow/core/kernels/data/group_by_window_dataset_op.cc')
-rw-r--r-- | tensorflow/core/kernels/data/group_by_window_dataset_op.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/data/group_by_window_dataset_op.cc b/tensorflow/core/kernels/data/group_by_window_dataset_op.cc index 834c06bb93..46f43dd1b1 100644 --- a/tensorflow/core/kernels/data/group_by_window_dataset_op.cc +++ b/tensorflow/core/kernels/data/group_by_window_dataset_op.cc @@ -263,6 +263,11 @@ class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { } const int64 window_size = window_size_func_output[0].scalar<int64>()(); + if (window_size <= 0) { + return errors::InvalidArgument( + "Window size must be greater than zero, but got ", + window_size, "."); + } window_sizes_[key] = window_size; } |