Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Apple Silicon support. #756

Merged
merged 7 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions oss_scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ function is_macos() {
# Remove .bazelrc if it already exist
[ -e .bazelrc ] && rm .bazelrc

if [[ $(pip show tensorflow) == *tensorflow* ]] || [[ $(pip show tf-nightly) == *tf-nightly* ]] ; then
if [[ $(pip show tensorflow) == *tensorflow* ]] ||
[[ $(pip show tensorflow-macos) == *tensorflow-macos* ]] ||
[[ $(pip show tf-nightly) == *tf-nightly* ]]; then
echo 'Using installed tensorflow.'
else
echo 'Installing tensorflow.'
pip install tensorflow==2.7.0
if is_macos; then
# Only Apple Silicon will be installed with tensorflow-macos.
if [[ x"$(arch)" == x"arm64" ]]; then
pip install tensorflow-macos==2.6.0
else
pip install tensorflow==2.7.0
fi
else
pip install tensorflow==2.7.0
fi
fi

if is_windows; then
Expand Down
6 changes: 5 additions & 1 deletion oss_scripts/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ function abspath() {

plat_name=""
if is_macos; then
plat_name="--plat-name macosx-10.9-x86_64"
if [[ x"$(arch)" == x"arm64" ]]; then
plat_name="--plat-name macosx_11_0_arm64"
else
plat_name="--plat-name macosx-10.9-x86_64"
fi
fi

main() {
Expand Down
1 change: 0 additions & 1 deletion oss_scripts/pip_package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def finalize_options(self):
cmdclass={'install': InstallPlatlib},
distclass=BinaryDistribution,
install_requires=[
'tensorflow>=2.7.0, <2.8',
'tensorflow_hub>=0.8.0',
],
extras_require={
Expand Down