Validate the shape of TakeDataset and SkipDataset (#18267)
authorYong Tang <yong.tang.github@outlook.com>
Fri, 6 Apr 2018 00:17:25 +0000 (17:17 -0700)
committerAndrew Harp <andrewharp@users.noreply.github.com>
Fri, 6 Apr 2018 00:17:25 +0000 (20:17 -0400)
commita1fbdf8268d8043190fe7fa0b3c5796a455ea529
tree702338306158a011394cc3a8f10a423847b42fe4
parentcde06a39592a849a2bc0ba022e858e6366c87cc5
Validate the shape of TakeDataset and SkipDataset (#18267)

* Validate the shape of TakeDataset and SkipDataset

The `count` inputs of the TakeDataset and SkipDataset require
scalar. That was not validated before though.

This fix validates the shape of count for TakeDataset and SkipDataset.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test case for invalide `count` of TakeDataset

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Validate shape of count for SkipDataset

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test case for invalid count shape for SkipDataset

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
tensorflow/contrib/data/python/kernel_tests/sequence_dataset_op_test.py
tensorflow/core/ops/dataset_ops.cc