message: Replace faulty overflow check with a builder for `TensorShape`.
  Prevents an integer overflow that was not caught before.
diff: @@ -263,22 +263,10 @@ class AddManySparseToTensorsMapOp : public SparseTensorAccessingOp {
  "Rank of input SparseTensor should be > 1, but saw rank: ", rank));
  auto input_shape_vec = input_shape->vec<int64>();
  - int new_num_elements = 1;
  - bool overflow_ocurred = false;
  - for (int i = 0; i < input_shape_vec.size(); i++) {
  - new_num_elements =
  - MultiplyWithoutOverflow(new_num_elements, input_shape_vec(i));
  - if (new_num_elements < 0) {
  - overflow_ocurred = true;
  - break;
  - }
  - }
  -
  - OP_REQUIRES(
  - context, !overflow_ocurred,
  - errors::Internal("Encountered overflow from large input shape."));
  - TensorShape tensor_input_shape(input_shape_vec);
  + TensorShape tensor_input_shape;
  + OP_REQUIRES_OK(context, TensorShape::BuildTensorShape(input_shape_vec,
  + &tensor_input_shape));
  gtl::InlinedVector<int64, 8> std_order(rank);
  std::iota(std_order.begin(), std_order.end(), 0);
  SparseTensor input_st;
  