Skip to content
Permalink
Browse files Browse the repository at this point in the history
In tf.raw_ops.BoostedTreesSparseCalculateBestFeatureSplit, limit stat…
…_dim in stats_summary_indices to under stats_dims in stats_summary_shape

PiperOrigin-RevId: 387171191
Change-Id: I83ca8a75b22aa78c037e8b98779da6cced16bfaa
  • Loading branch information
pak-laura authored and tensorflower-gardener committed Jul 27, 2021
1 parent 2e0ee46 commit e84c975
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tensorflow/core/kernels/boosted_trees/stats_ops.cc
Expand Up @@ -1050,6 +1050,13 @@ class BoostedTreesSparseCalculateBestFeatureSplitOp : public OpKernel {
const int32_t feature_dim = stats_summary_indices(idx, 1);
const int32_t bucket_id = stats_summary_indices(idx, 2);
const int32_t stat_dim = stats_summary_indices(idx, 3);
OP_REQUIRES(context, stat_dim < stats_dims,
errors::InvalidArgument(
"Stat dim, the sum of logits dim and hessian dim in "
"stats_summary_indices, cannot be greater than stats "
"dims, the last value in stats_summary_shape, which was ",
stats_dims, ". At index (", idx,
", 4), stats_summary_indices contains value ", stat_dim));
std::pair<FeatureMapIterator, bool> const& f_insert_result = f_map.insert(
FeatureMapIterator::value_type(feature_dim, BucketMap()));
auto& b_map = f_insert_result.first->second;
Expand Down

0 comments on commit e84c975

Please sign in to comment.