Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
tensorflow
提交
43b04314
T
tensorflow
项目概览
xxadev
/
tensorflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
1
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 搜索 >>
提交
43b04314
编写于
10月 11, 2018
作者:
T
Tong Shen
提交者:
TensorFlower Gardener
10月 11, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move ParseHostComputeCore to side_effect_util.cc. No functionality change.
PiperOrigin-RevId: 216748472
上级
3fd902b2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
0 deletion
+32
-0
tensorflow/compiler/tf2xla/BUILD
tensorflow/compiler/tf2xla/BUILD
+1
-0
tensorflow/compiler/tf2xla/side_effect_util.cc
tensorflow/compiler/tf2xla/side_effect_util.cc
+25
-0
tensorflow/compiler/tf2xla/side_effect_util.h
tensorflow/compiler/tf2xla/side_effect_util.h
+6
-0
未找到文件。
tensorflow/compiler/tf2xla/BUILD
浏览文件 @
43b04314
...
...
@@ -662,5 +662,6 @@ cc_library(
hdrs
=
[
"side_effect_util.h"
],
deps
=
[
"//tensorflow/core:core_cpu"
,
"@com_google_absl//absl/strings"
,
],
)
tensorflow/compiler/tf2xla/side_effect_util.cc
浏览文件 @
43b04314
...
...
@@ -15,6 +15,7 @@ limitations under the License.
#include "tensorflow/compiler/tf2xla/side_effect_util.h"
#include "absl/strings/numbers.h"
#include "tensorflow/core/graph/algorithm.h"
namespace
tensorflow
{
...
...
@@ -64,4 +65,28 @@ bool HasSideEffectingNodes(const Graph& g) {
return
false
;
}
Status
ParseHostComputeCoreList
(
absl
::
Span
<
const
string
>
list_from_attr
,
std
::
map
<
string
,
int
>*
host_compute_core
)
{
for
(
const
auto
&
hc_core
:
list_from_attr
)
{
std
::
vector
<
string
>
parts
=
str_util
::
Split
(
hc_core
,
":"
);
if
(
parts
.
size
()
!=
2
)
{
return
errors
::
InvalidArgument
(
"Malformed host_compute_core entry "
,
hc_core
,
" should be <cluster_name>:<core_number>."
);
}
int
core
;
if
(
!
absl
::
numbers_internal
::
safe_strto32_base
(
parts
[
1
],
&
core
,
10
))
{
return
errors
::
InvalidArgument
(
"Malformed host_compute_core entry "
,
hc_core
,
" part after ':' should be an integer."
);
}
if
(
host_compute_core
->
find
(
parts
[
0
])
!=
host_compute_core
->
end
())
{
return
errors
::
InvalidArgument
(
"Duplicate host_compute_core entry for cluster "
,
parts
[
0
]);
}
(
*
host_compute_core
)[
parts
[
0
]]
=
core
;
}
return
Status
::
OK
();
}
}
// namespace tensorflow
tensorflow/compiler/tf2xla/side_effect_util.h
浏览文件 @
43b04314
...
...
@@ -42,6 +42,12 @@ std::set<std::string> CalculateTokenInputsForOutputToken(const Graph& g);
// Returns whether a graph contains side-effecting nodes.
bool
HasSideEffectingNodes
(
const
Graph
&
g
);
// Parse the mapping from outside_compilation_subgraph name to core number,
// which is specified in an attr as a list of strings
// <subgraph_name>:<core_index>.
Status
ParseHostComputeCoreList
(
absl
::
Span
<
const
string
>
list_from_attr
,
std
::
map
<
string
,
int
>*
host_compute_core
);
}
// namespace tensorflow
#endif // TENSORFLOW_COMPILER_TF2XLA_SIDE_EFFECT_UTIL_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录