Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38905368
tensorflow
提交
61f5a61d
T
tensorflow
项目概览
qq_38905368
/
tensorflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
61f5a61d
编写于
3月 07, 2019
作者:
S
Smit Hinsu
提交者:
TensorFlower Gardener
3月 07, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Automated rollback of commit
fc85579a
PiperOrigin-RevId: 237367210
上级
4e259b29
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
7 addition
and
102 deletion
+7
-102
tensorflow/opensource_only.files
tensorflow/opensource_only.files
+1
-2
tensorflow/python/autograph/core/config.py
tensorflow/python/autograph/core/config.py
+1
-5
tensorflow/tools/pip_package/build_pip_package.sh
tensorflow/tools/pip_package/build_pip_package.sh
+0
-54
tensorflow/tools/pip_package/setup.py
tensorflow/tools/pip_package/setup.py
+5
-5
tensorflow/virtual_root.__init__.py
tensorflow/virtual_root.__init__.py
+0
-36
未找到文件。
tensorflow/opensource_only.files
浏览文件 @
61f5a61d
...
...
@@ -242,5 +242,4 @@ tensorflow/api_template_v1.__init__.py
tensorflow/compat_template_v1.__init__.py
tensorflow/compat_template.__init__.py
tensorflow/api_template.__init__.py
tensorflow/__init__.py
tensorflow/virtual_root.__init__.py
\ No newline at end of file
tensorflow/__init__.py
\ No newline at end of file
tensorflow/python/autograph/core/config.py
浏览文件 @
61f5a61d
...
...
@@ -37,11 +37,7 @@ def _internal_name(name):
# If the TF module is foo.tensorflow, then all other modules
# are then assumed to be prefixed by 'foo'.
# TODO(mihaimaruseac): Fix this hack once estimator move is finished
core_reference_root
=
'tensorflow_core.'
if
reference_name
.
startswith
(
reference_root
)
or
\
reference_name
.
startswith
(
core_reference_root
):
if
reference_name
.
startswith
(
reference_root
):
return
name
reference_begin
=
reference_name
.
find
(
'.'
+
reference_root
)
...
...
tensorflow/tools/pip_package/build_pip_package.sh
浏览文件 @
61f5a61d
...
...
@@ -132,7 +132,6 @@ function prepare_src() {
popd
>
/dev/null
cp
-R
$RUNFILES
/third_party/eigen3
${
TMPDIR
}
/third_party
cp
tensorflow/virtual_root.__init__.py
${
TMPDIR
}
cp
tensorflow/tools/pip_package/MANIFEST.in
${
TMPDIR
}
cp
tensorflow/tools/pip_package/README
${
TMPDIR
}
cp
tensorflow/tools/pip_package/setup.py
${
TMPDIR
}
...
...
@@ -155,59 +154,6 @@ function build_wheel() {
fi
pushd
${
TMPDIR
}
>
/dev/null
# In order to break the circular dependency between tensorflow and
# tensorflow_estimator which forces us to do a multi-step release, we are
# creating a virtual pip package called tensorflow and moving all the tf code
# into another pip called tensorflow_core. Then estimator can depend on
# tensorflow_core (both import tensorflow and import tensorflow_core will work
# but it's recommended to use import tensorflow_core to be future proof) and
# tensorflow_core and tensorflow_estimator can be released at will and only
# when they are at a release-able point we can just do a single release for
# the virtual tensorflow package.
# At the moment, we are doing all these changes in the following two blocks:
#
# * move code from tensorflow to tensorflow_core and change imports so that
# code on the new directory is imported (this needs a few sed changes
# to convert extra changes back to the original code, see inline comments
# on the first block below)
# * create the virtual pip package: create folder and __init__.py file
#
# This is transparent to internal code or to code not using the pip packages,
# so the only concerns here are from failures that might occur in the pip
# world:
#
# * Adding a new file which contains tensorflow on the same line as import
# but not needing that tensorflow to be renamed to tensorflow_core: in
# this case, we just need to add a reverse sed below the for loop, like
# the one we have fr _pywrap_tensorflow and for the keras import
# * Needing more specialized code in the virtual pip's __init__.py: we just
# need to change the virtual_root.__init__.py file to include that code
# * Needing additional version constraints on the virtual pip: that is not
# supported at the moment, but I hope to move to the next step of the
# split before we need these constraints (I don't foresee any such
# constraints being needed)
## Setup for tensorflow_core internal module
mv
tensorflow tensorflow_core
pushd
tensorflow_core
>
/dev/null
for
f
in
`
find
.
-name
"*.py"
`
;
do
sed
-i
-e
"/import/ s/tensorflow/tensorflow_core/"
$f
done
# The above for loop does one extra replacement where it should not, fix it here
sed
-i
-e
"/import/ s/_pywrap_tensorflow_core/_pywrap_tensorflow/"
python/pywrap_tensorflow_internal.py
# We need to have keras from tensorflow for tests but from tensorflow_core for pip
sed
-i
-e
"s/tensorflow.python.keras/tensorflow_core.python.keras/"
__init__.py
# TODO(mihaimaruseac): Not removing these results in AttributeErrors during import so we have this hack
# I don't see a future change where we would have to remove more internal modules
sed
-i
-e
"s/del python/pass/"
-e
"s/del core/pass/"
__init__.py
popd
>
/dev/null
# Now, create the virtual pip package
mkdir
tensorflow
pushd
tensorflow
>
/dev/null
mv
../virtual_root.__init__.py __init__.py
popd
>
/dev/null
rm
-f
MANIFEST
echo
$(
date
)
:
"=== Building wheel"
"
${
PYTHON_BIN_PATH
:-
python
}
"
setup.py bdist_wheel
${
PKG_NAME_FLAG
}
>
/dev/null
...
...
tensorflow/tools/pip_package/setup.py
浏览文件 @
61f5a61d
...
...
@@ -134,8 +134,8 @@ class InstallCommand(InstallCommandBase):
def
finalize_options
(
self
):
ret
=
InstallCommandBase
.
finalize_options
(
self
)
self
.
install_headers
=
os
.
path
.
join
(
self
.
install_purelib
,
'tensorflow_core'
,
'include'
)
self
.
install_headers
=
os
.
path
.
join
(
self
.
install_purelib
,
'
tensorflow'
,
'
include'
)
return
ret
...
...
@@ -172,14 +172,14 @@ class InstallHeaders(Command):
# directories for -I
install_dir
=
re
.
sub
(
'/google/protobuf_archive/src'
,
''
,
install_dir
)
# Copy external code headers into tensorflow
_core
/include.
# Copy external code headers into tensorflow/include.
# A symlink would do, but the wheel file that gets created ignores
# symlink within the directory hierarchy.
# NOTE(keveman): Figure out how to customize bdist_wheel package so
# we can do the symlink.
external_header_locations
=
[
'tensorflow
_core
/include/external/eigen_archive/'
,
'tensorflow
_core
/include/external/com_google_absl/'
,
'tensorflow/include/external/eigen_archive/'
,
'tensorflow/include/external/com_google_absl/'
,
]
for
location
in
external_header_locations
:
if
location
in
install_dir
:
...
...
tensorflow/virtual_root.__init__.py
已删除
100644 → 0
浏览文件 @
4e259b29
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""
Bring in all of the public TensorFlow interface into this module (virtual pip).
"""
from
__future__
import
absolute_import
as
_absolute_import
from
__future__
import
division
as
_division
from
__future__
import
print_function
as
_print_function
try
:
from
tensorflow_core
import
*
# These need to be explicitly imported
from
tensorflow_core
import
__path__
as
_new_path
from
tensorflow_core
import
keras
__path__
=
__path__
+
_new_path
except
ImportError
as
e
:
pass
try
:
from
tensorflow_estimator
import
__path__
as
_new_path
__path__
=
__path__
+
_new_path
except
ImportError
as
e
:
pass
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录