Skip to content

Commit

Permalink
Release TF-DF 1.2.0 and YDF 1.3.0
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 504351088
  • Loading branch information
achoum authored and copybara-github committed Jan 24, 2023
1 parent c7e86e0 commit e1c3841
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## HEAD
## 1.3.0 - 2023-01-24

### Features

Expand Down
54 changes: 28 additions & 26 deletions third_party/boost/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")

def deps(prefix = ""):
def deps(prefix = "", from_git_repo = True):
branch = "boost-1.75.0"
# branch = "master"
# branch = "develop"
Expand All @@ -20,30 +20,32 @@ cc_library(
)
"""

new_git_repository(
name = "org_boost",
branch = branch,
build_file_content = build_file_content,
init_submodules = True,
recursive_init_submodules = True,
remote = "https://github.com/boostorg/boost",
)
if from_git_repo:
new_git_repository(
name = "org_boost",
branch = branch,
build_file_content = build_file_content,
init_submodules = True,
recursive_init_submodules = True,
remote = "https://github.com/boostorg/boost",
)

# Bazel has a 10 minutes timeout on most commands. If getting Boost
# times-out (boost is composed of many sub repositories), do the following:
#
# PS: Make sure this is not your anti-virus that is slowing things down.
#
# 1. Create a new directory in your homespace (e.g. "dependencies").
# 2. Open a shell in this directory and run:
# git clone --branch boost-1.75.0 https://github.com/boostorg/boost.git
# cd boost
# git submodule update --init --checkout --force
# 3. Comment the "new_git_repository" rule above, and uncomment the
# "new_local_repository" rule below.
else:
# Bazel has a 10 minutes timeout on most commands. If getting Boost
# times-out (boost is composed of many sub repositories), do the following:
#
# PS: Make sure this is not your anti-virus that is slowing things down.
#
# 1. Create a new directory in your homespace (e.g. "dependencies").
# 2. Open a shell in this directory and run:
# git clone --branch boost-1.75.0 https://github.com/boostorg/boost.git
# cd boost
# git submodule update --init --checkout --force
# 3. Comment the "new_git_repository" rule above, and uncomment the
# "new_local_repository" rule below.

# native.new_local_repository(
# name = "org_boost",
# path = "../boost",
# build_file_content = build_file_content,
# )
native.new_local_repository(
name = "org_boost",
path = "../boost",
build_file_content = build_file_content,
)
5 changes: 3 additions & 2 deletions yggdrasil_decision_forests/serving/example_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ FeaturesDefinitionNumericalOrCategoricalFlat::unstacked_features() const {

bool FeaturesDefinitionNumericalOrCategoricalFlat::HasInputFeature(
const absl::string_view name) const {
return feature_def_cache_.find(name) != feature_def_cache_.end() ||
indexed_unstacked_features_.find(name) !=
return feature_def_cache_.find(std::string(name)) !=
feature_def_cache_.end() ||
indexed_unstacked_features_.find(std::string(name)) !=
indexed_unstacked_features_.end();
}

Expand Down
11 changes: 6 additions & 5 deletions yggdrasil_decision_forests/serving/example_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include <ostream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -219,7 +220,7 @@ class FeaturesDefinitionNumericalOrCategoricalFlat {
// is not used by the model as input.
absl::StatusOr<const FeatureDef*> FindFeatureDefByName(
const absl::string_view name) const {
auto cached_feature_it = feature_def_cache_.find(name);
auto cached_feature_it = feature_def_cache_.find(std::string(name));
if (cached_feature_it != feature_def_cache_.end()) {
// The feature was found.
return cached_feature_it->second;
Expand Down Expand Up @@ -255,7 +256,7 @@ class FeaturesDefinitionNumericalOrCategoricalFlat {
// Gets the unstacked feature definition from its name.
absl::StatusOr<const UnstackedFeature*> FindUnstackedFeatureDefByName(
const absl::string_view name) const {
auto it_index = indexed_unstacked_features_.find(name);
auto it_index = indexed_unstacked_features_.find(std::string(name));
if (it_index == indexed_unstacked_features_.end()) {
return absl::InvalidArgumentError(
absl::Substitute("Unknown unstacked feature $0", name));
Expand Down Expand Up @@ -339,7 +340,7 @@ class FeaturesDefinitionNumericalOrCategoricalFlat {
absl::StatusOr<MultiDimNumericalFeatureId> GetMultiDimNumericalFeatureId(
const absl::string_view name) const {
// Get the unstacked feature information.
const auto it_index = indexed_unstacked_features_.find(name);
const auto it_index = indexed_unstacked_features_.find(std::string(name));
if (it_index == indexed_unstacked_features_.end()) {
return absl::InvalidArgumentError(
absl::StrFormat("Unknown feature %s", name));
Expand Down Expand Up @@ -419,13 +420,13 @@ class FeaturesDefinitionNumericalOrCategoricalFlat {

// Index to the "fixed_length_features_" and "categorical_set_features_" by
// "name".
absl::flat_hash_map<std::string, const FeatureDef*> feature_def_cache_;
std::unordered_map<std::string, const FeatureDef*> feature_def_cache_;

// List of "unstacked" features (similar to "unstackeds" in the dataspec).
std::vector<UnstackedFeature> unstacked_features_;

// Index "original name" to its index in "unstacked_features_".
absl::flat_hash_map<std::string, int> indexed_unstacked_features_;
std::unordered_map<std::string, int> indexed_unstacked_features_;
};

using FeaturesDefinition = FeaturesDefinitionNumericalOrCategoricalFlat;
Expand Down

0 comments on commit e1c3841

Please sign in to comment.