Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 610341553
  • Loading branch information
SimpleML Team authored and copybara-github committed Feb 26, 2024
1 parent 0d546cf commit 3c467c6
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
58 changes: 29 additions & 29 deletions tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ tensorflow::Status YggdrasilModelContainer::LoadModel(
}

YDF_LOG(INFO) << "Loading model from " << model_path;
return tf::OkStatus();
return absl::OkStatus();
}

// OP loading a model from disk to memory.
Expand Down Expand Up @@ -195,7 +195,7 @@ tf::Status FeatureSet::Link(
}
}

return tf::OkStatus();
return absl::OkStatus();
}

tf::Status FeatureSet::IterateFeatures(
Expand Down Expand Up @@ -235,46 +235,46 @@ tf::Status FeatureSet::IterateFeatures(
TF_RETURN_IF_ERROR(lambda_hash(feature.second, feature.first));
}

return tf::OkStatus();
return absl::OkStatus();
}

tf::Status FeatureSet::Unlink() {
TF_RETURN_IF_ERROR(IterateFeatures(
[](SimpleMLNumericalFeature::Resource* feature, const int feature_idx) {
feature->Unref();
return tf::OkStatus();
return absl::OkStatus();
},
[](SimpleMLCategoricalStringFeature::Resource* feature,
const int feature_idx) {
feature->Unref();
return tf::OkStatus();
return absl::OkStatus();
},
[](SimpleMLCategoricalIntFeature::Resource* feature,
const int feature_idx) {
feature->Unref();
return tf::OkStatus();
return absl::OkStatus();
},
[](SimpleMLCategoricalSetStringFeature::Resource* feature,
const int feature_idx) {
feature->Unref();
return tf::OkStatus();
return absl::OkStatus();
},
[](SimpleMLCategoricalSetIntFeature::Resource* feature,
const int feature_idx) {
feature->Unref();
return tf::OkStatus();
return absl::OkStatus();
},
[](SimpleMLHashFeature::Resource* feature, const int feature_idx) {
feature->Unref();
return tf::OkStatus();
return absl::OkStatus();
}));
numerical_features_.clear();
categorical_string_features_.clear();
categorical_int_features_.clear();
categorical_set_string_features_.clear();
categorical_set_int_features_.clear();
hash_features_.clear();
return tf::OkStatus();
return absl::OkStatus();
}

// Initialize a dataset (including the dataset's dataspec) from the linked
Expand All @@ -292,7 +292,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
if (num_examples == -1) {
num_examples = observed_num_examples;
num_batches = observed_num_batches;
return tf::OkStatus();
return absl::OkStatus();
}
if (num_examples != observed_num_examples) {
return tf::Status(
Expand All @@ -301,7 +301,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
"different input features $0 != $1.",
num_examples, observed_num_examples));
}
return tf::OkStatus();
return absl::OkStatus();
};

for (int feature_idx = 0; feature_idx < NumFeatures(); feature_idx++) {
Expand Down Expand Up @@ -346,7 +346,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
TF_RETURN_IF_ERROR(apply_guide(feature->feature_name(), col));
TF_RETURN_IF_ERROR(set_num_examples(feature->indexed_data().size(),
feature->NumBatches()));
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalIntFeature::Resource* feature,
const int feature_idx) {
Expand Down Expand Up @@ -420,7 +420,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
dataset::UpdateComputeSpecDiscretizedNumerical(value, col, col_acc);
}
}
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalStringFeature::Resource* feature,
const int feature_idx) {
Expand All @@ -432,7 +432,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
dataset::UpdateCategoricalStringColumnSpec(
reverse_index[indexed_value], col, col_acc));
}
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalIntFeature::Resource* feature,
const int feature_idx) {
Expand All @@ -442,7 +442,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
TF_RETURN_IF_ERROR_FROM_ABSL_STATUS(
dataset::UpdateCategoricalIntColumnSpec(value, col, col_acc));
}
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalSetStringFeature::Resource* feature,
const int feature_idx) {
Expand All @@ -452,7 +452,7 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
TF_RETURN_IF_ERROR_FROM_ABSL_STATUS(
dataset::UpdateCategoricalStringColumnSpec(value, col, col_acc));
}
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalSetIntFeature::Resource* feature,
const int feature_idx) {
Expand All @@ -462,17 +462,17 @@ tf::Status FeatureSet::InitializeDatasetFromFeatures(
TF_RETURN_IF_ERROR_FROM_ABSL_STATUS(
dataset::UpdateCategoricalIntColumnSpec(value, col, col_acc));
}
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLHashFeature::Resource* feature, const int feature_idx) {
// Nothing to do.
return tf::OkStatus();
return absl::OkStatus();
}));

TF_RETURN_IF_ERROR_FROM_ABSL_STATUS(dataset::FinalizeComputeSpec(
guide, accumulator, dataset->mutable_data_spec()));

return tf::OkStatus();
return absl::OkStatus();
}

tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
Expand All @@ -492,7 +492,7 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
"between features for feature $0 != $1. For feature $2.",
dataset->nrow(), num_rows, feature->feature_name()));
}
return tf::OkStatus();
return absl::OkStatus();
};

TF_RETURN_IF_ERROR(IterateFeatures(
Expand Down Expand Up @@ -524,7 +524,7 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
*col_data->mutable_values() = std::move(*feature->mutable_data());
}
feature->mutable_data()->clear();
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalStringFeature::Resource* feature,
const int feature_idx) -> tensorflow::Status {
Expand All @@ -550,7 +550,7 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
}
// Note: Thread annotations don't work in lambdas.
feature->non_mutex_protected_clear();
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalIntFeature::Resource* feature,
const int feature_idx) -> tensorflow::Status {
Expand All @@ -573,7 +573,7 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
col_data->Add(value);
}
feature->mutable_data()->clear();
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalSetStringFeature::Resource* feature,
const int feature_idx) -> tensorflow::Status {
Expand Down Expand Up @@ -612,7 +612,7 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
col_data->AddVector(tmp_value);
}
feature->non_mutex_protected_clear();
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLCategoricalSetIntFeature::Resource* feature,
const int feature_idx) -> tensorflow::Status {
Expand Down Expand Up @@ -664,7 +664,7 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
col_data->AddVector(tmp_value);
}
feature->non_mutex_protected_clear();
return tf::OkStatus();
return absl::OkStatus();
},
[&](SimpleMLHashFeature::Resource* feature,
const int feature_idx) -> tensorflow::Status {
Expand All @@ -675,10 +675,10 @@ tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset(
dataset::VerticalDataset::HashColumn>(feature_idx));
*col_data->mutable_values() = std::move(*feature->mutable_data());
feature->mutable_data()->clear();
return tf::OkStatus();
return absl::OkStatus();
}));

return tf::OkStatus();
return absl::OkStatus();
}

int FeatureSet::NumFeatures() const {
Expand Down Expand Up @@ -974,7 +974,7 @@ class SimpleMLModelTrainer : public tensorflow::OpKernel {
feature_set.InitializeDatasetFromFeatures(ctx, guide_, dataset));
TF_RETURN_IF_ERROR(
feature_set.MoveExamplesFromFeaturesToDataset(ctx, dataset));
return tf::OkStatus();
return absl::OkStatus();
}

bool HasTrainingExamples(tf::OpKernelContext* ctx) {
Expand Down
Loading

0 comments on commit 3c467c6

Please sign in to comment.