Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdong authored Jan 6, 2025
2 parents 7eec572 + c94b4ab commit 67cc2e6
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.9
- run: pip install pygithub click
- name: Check that the CODEOWNERS is valid
run: python .github/workflows/notify_codeowners.py .github/CODEOWNERS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify_codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.9
- run: pip install pygithub click
- name: Drop a message for codeowners
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
matrix:
# TODO: add back 'windows-latest' when it can be compiled.
os: ['macos-14', 'macos-12', 'ubuntu-20.04']
os: ['macos-14', 'macos-13', 'ubuntu-20.04']
py-version: ['3.8', '3.9', '3.10', '3.11']
tf-version: ['2.15.1', '2.16.2']
tf-need-cuda: ['0']
Expand All @@ -59,7 +59,7 @@ jobs:
cpu: 'x86'
- os: 'ubuntu-20.04'
cpu: 'arm64'
- os: 'macos-12'
- os: 'macos-13'
cpu: 'arm64'
- py-version: '3.8'
cpu: 'arm64'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def call(self, features):
boundaries=fea_info['boundaries'])(input_tensor)
# To prepare for GPU table combined queries, use a prefix to distinguish different features in a table.
if fea_info['ptype'] == 'user_occupation_label':
input_tensor_prefix_code = int(fea_info['code']) << 1
input_tensor_prefix_code = int(fea_info['code']) << 48
else:
input_tensor_prefix_code = None
if input_tensor_prefix_code is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,42 +83,43 @@ py_test(
# ],
# )

py_test(
name = "math_ops_test",
srcs = ["math_ops_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
"//tensorflow_recommenders_addons",
],
)
# Remove the following tests due to there are well-support operators in latest Tensorflow version.
# py_test(
# name = "math_ops_test",
# srcs = ["math_ops_test.py"],
# python_version = "PY3",
# srcs_version = "PY3",
# deps = [
# "//tensorflow_recommenders_addons",
# ],
# )

py_test(
name = "math_grad_test",
srcs = ["math_grad_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
"//tensorflow_recommenders_addons",
],
)
# py_test(
# name = "math_grad_test",
# srcs = ["math_grad_test.py"],
# python_version = "PY3",
# srcs_version = "PY3",
# deps = [
# "//tensorflow_recommenders_addons",
# ],
# )

py_test(
name = "dynamic_partition_op_test",
srcs = ["dynamic_partition_op_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
"//tensorflow_recommenders_addons",
],
)
# py_test(
# name = "dynamic_partition_op_test",
# srcs = ["dynamic_partition_op_test.py"],
# python_version = "PY3",
# srcs_version = "PY3",
# deps = [
# "//tensorflow_recommenders_addons",
# ],
# )

py_test(
name = "dynamic_stitch_op_test",
srcs = ["dynamic_stitch_op_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
"//tensorflow_recommenders_addons",
],
)
# py_test(
# name = "dynamic_stitch_op_test",
# srcs = ["dynamic_stitch_op_test.py"],
# python_version = "PY3",
# srcs_version = "PY3",
# deps = [
# "//tensorflow_recommenders_addons",
# ],
# )
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@
from tensorflow_recommenders_addons.utils.resource_loader import LazySO

tfra_data_flow_ops = LazySO("dynamic_embedding/core/_data_flow_ops.so").ops
# TODO(MoFHeka): dynamic_partition and dynamic_stitch in TensorFlow
# NOTE(MoFHeka): dynamic_partition and dynamic_stitch in TensorFlow
# missing compile implementation of the bool data type.
# Remove TFRA DE same-name op when TensorFlow supports those data type.


def dynamic_partition(data, partitions, num_partitions, name=None):
if not hasattr(tfra_data_flow_ops, 'tfra_dynamic_partition'):
tf_logging.warn(
'`tfra.dynamic_embedding.data_flow.dynamic_partition` is not'
' found. Use tf.dynamic_partition instead.')
with ops.colocate_with(None, ignore_existing=True):
return tf.dynamic_partition(data, partitions, num_partitions, name=name)
else:
Expand All @@ -53,8 +50,6 @@ def dynamic_partition(data, partitions, num_partitions, name=None):

def dynamic_stitch(indices, data, use_fast=True, name=None):
if not hasattr(tfra_data_flow_ops, 'tfra_dynamic_stitch'):
tf_logging.warn('`tfra.dynamic_embedding.data_flow.dynamic_stitch` is not'
' found. Use tf.dynamic_stitch instead.')
with ops.colocate_with(None, ignore_existing=True):
return tf.dynamic_stitch(indices, data, name=name)
else:
Expand Down

0 comments on commit 67cc2e6

Please sign in to comment.