Skip to content

Commit d62c91d

Browse files
rstzcopybara-github
authored andcommitted
Prepare release of TF-DF 1.9.2 and PYDF 0.6.0
PiperOrigin-RevId: 650123651
1 parent 57f260f commit d62c91d

File tree

7 files changed

+38
-34
lines changed

7 files changed

+38
-34
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 1.9.2 - 2024-07-04
4+
5+
### Fix
6+
7+
- Fix compatibility with TF 2.16.2.
8+
- Fix build.
9+
310
## 1.9.1 - 2024-05-07
411

512
### Fix

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1111
# absl used by tensorflow.
1212
http_archive(
1313
name = "org_tensorflow",
14-
strip_prefix = "tensorflow-2.16.1",
15-
sha256 = "c729e56efc945c6df08efe5c9f5b8b89329c7c91b8f40ad2bb3e13900bd4876d",
16-
urls = ["https://github.com/tensorflow/tensorflow/archive/v2.16.1.tar.gz"],
14+
strip_prefix = "tensorflow-2.16.2",
15+
sha256 = "023849bf253080cb1e4f09386f5eb900492da2288274086ed6cfecd6d99da9eb",
16+
urls = ["https://github.com/tensorflow/tensorflow/archive/v2.16.2.tar.gz"],
1717
# Starting with TF 2.14, disable hermetic Python builds.
1818
patch_args = ["-p1"],
1919
patches = ["//third_party/tensorflow:tf.patch"],

configure/setup.py

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
"""
1919

2020
import platform
21+
import sys
2122
import setuptools
2223
from setuptools.command.install import install
2324
from setuptools.dist import Distribution
2425

25-
_VERSION = "1.9.1"
26+
_VERSION = "1.9.2"
2627

2728
with open("README.md", "r", encoding="utf-8") as fh:
2829
long_description = fh.read()
2930

3031
REQUIRED_PACKAGES = [
3132
"numpy",
3233
"pandas",
33-
"tensorflow~=2.16.1",
34+
"tensorflow==2.16.2",
3435
"six",
3536
"absl_py",
3637
"wheel",
@@ -57,31 +58,26 @@ def is_pure(self):
5758
return False
5859

5960

60-
try:
61-
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
62-
63-
class bdist_wheel(_bdist_wheel):
64-
65-
def finalize_options(self):
66-
_bdist_wheel.finalize_options(self)
67-
self.root_is_pure = False
68-
69-
def get_tag(self):
70-
python, abi, plat = _bdist_wheel.get_tag(self)
71-
if platform.system() == "Darwin":
72-
# Uncomment on of the lines below to adapt the platform string when
73-
# cross-compiling.
74-
plat = "macosx_12_0_arm64"
75-
# plat = "macosx_10_15_x86_64"
76-
pass
77-
return python, abi, plat
78-
79-
except ImportError:
80-
bdist_wheel = None
61+
if "bdist_wheel" in sys.argv:
62+
if "--plat-name" not in sys.argv:
63+
if platform.system() == "Darwin":
64+
idx = sys.argv.index("bdist_wheel") + 1
65+
sys.argv.insert(idx, "--plat-name")
66+
if platform.processor() == "arm":
67+
sys.argv.insert(idx + 1, "macosx_10_15_x86_64")
68+
elif platform.processor() == "i386":
69+
sys.argv.insert(idx + 1, "macosx_12_0_arm64")
70+
else:
71+
raise ValueError(f"Unknown processor {platform.processor()}")
72+
else:
73+
print("Not on MacOS")
74+
else:
75+
print("PLAT-NAME Supplied")
76+
else:
77+
print("NO BDIST_WHEEL")
8178

8279
setuptools.setup(
8380
cmdclass={
84-
"bdist_wheel": bdist_wheel,
8581
"install": InstallPlatlib,
8682
},
8783
name="tensorflow_decision_forests",

documentation/known_issues.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The following table shows the compatibility between
5454

5555
tensorflow_decision_forests | tensorflow
5656
--------------------------- | ---------------
57+
1.9.2 | 2.16.2
5758
1.9.1 | 2.16.1
5859
1.9.0 | 2.16.1
5960
1.8.0 - 1.8.1 | 2.15.0

tensorflow_decision_forests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
```
5252
"""
5353

54-
__version__ = "1.9.1"
54+
__version__ = "1.9.2"
5555
__author__ = "Mathieu Guillame-Bert"
5656

57-
compatible_tf_versions = ["2.16.1"]
57+
compatible_tf_versions = ["2.16.2"]
5858
__git_version__ = "HEAD" # Modify for release build.
5959

6060
from tensorflow_decision_forests.tensorflow import check_version

tensorflow_decision_forests/keras/wrappers_pre_generated.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class CartModel(core.CoreModel):
289289
value for Random Forest: `sqrt(number of input attributes)` in case of
290290
classification and `number_of_input_attributes / 3` in case of regression.
291291
If `num_candidate_attributes=-1`, all the attributes are tested. Default:
292-
0.
292+
-1.
293293
num_candidate_attributes_ratio: Ratio of attributes tested at each node. If
294294
set, it is equivalent to `num_candidate_attributes =
295295
number_of_input_features x num_candidate_attributes_ratio`. The possible
@@ -308,7 +308,7 @@ class CartModel(core.CoreModel):
308308
training. This solution is faster but consumes much more memory than
309309
IN_NODE. - IN_NODE: The features are sorted just before being used in the
310310
node. This solution is slow but consumes little amount of memory. .
311-
Default: "PRESORT".
311+
Default: "IN_NODE".
312312
sparse_oblique_max_num_projections: For sparse oblique splits i.e.
313313
`split_axis=SPARSE_OBLIQUE`. Maximum number of projections (applied after
314314
the num_projections_exponent). Oblique splits try out
@@ -420,11 +420,11 @@ def __init__(
420420
mhld_oblique_sample_attributes: Optional[bool] = None,
421421
min_examples: Optional[int] = 5,
422422
missing_value_policy: Optional[str] = "GLOBAL_IMPUTATION",
423-
num_candidate_attributes: Optional[int] = 0,
423+
num_candidate_attributes: Optional[int] = -1,
424424
num_candidate_attributes_ratio: Optional[float] = -1.0,
425425
pure_serving_model: Optional[bool] = False,
426426
random_seed: Optional[int] = 123456,
427-
sorting_strategy: Optional[str] = "PRESORT",
427+
sorting_strategy: Optional[str] = "IN_NODE",
428428
sparse_oblique_max_num_projections: Optional[int] = None,
429429
sparse_oblique_normalization: Optional[str] = None,
430430
sparse_oblique_num_projections_exponent: Optional[float] = None,

tools/test_bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
# Usage example
2828
#
29-
# RUN_TESTS=1 PY_VERSION=3.9 TF_VERSION=2.16.1 ./tools/test_bazel.sh
29+
# RUN_TESTS=1 PY_VERSION=3.9 TF_VERSION=2.16.2 ./tools/test_bazel.sh
3030

3131
set -vex
3232

0 commit comments

Comments
 (0)