Commit af6b6016 by MORITA Kazutaka Committed by Tianqi Chen

axis bounds checking in split (#1178)

* Add kazum to contributers

* Add axis bounds checking in split
parent 9aae7274
......@@ -63,3 +63,4 @@ List of Contributors
- [Cody Hao Yu](https://github.com/comaniac)
- [Chris Nuernberger](https://github.com/cnuernber)
- [Tatsuya Nishiyama](https://github.com/nishi-t)
- [Kazutaka Morita](https://github.com/kazum)
......@@ -310,6 +310,8 @@ inline Array<Tensor> split(const Tensor& x,
if (axis < 0) {
axis += static_cast<int>(x->shape.size());
}
CHECK_LT(axis, x->shape.size()) << "axis out of bounds";
auto src_axis_size = static_cast<int>(GetConstInt(x->shape[axis]));
auto split_indices_val = GetConstIntValues(split_indices, "split_indices");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment