Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38905368
tensorflow
提交
88f97b9e
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,发现更多精彩内容 >>
提交
88f97b9e
编写于
6月 23, 2016
作者:
P
Pete Warden
提交者:
TensorFlower Gardener
6月 23, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added extra information to missing kernel error message
Change: 125660054
上级
bcc4dd68
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
8 deletion
+27
-8
tensorflow/core/framework/op_kernel.cc
tensorflow/core/framework/op_kernel.cc
+27
-8
未找到文件。
tensorflow/core/framework/op_kernel.cc
浏览文件 @
88f97b9e
...
@@ -708,8 +708,10 @@ Status AttrsMatch(const NodeDef& node_def, const KernelDef& kernel_def,
...
@@ -708,8 +708,10 @@ Status AttrsMatch(const NodeDef& node_def, const KernelDef& kernel_def,
}
}
Status
FindKernelRegistration
(
DeviceType
device_type
,
const
NodeDef
&
node_def
,
Status
FindKernelRegistration
(
DeviceType
device_type
,
const
NodeDef
&
node_def
,
const
KernelRegistration
**
reg
)
{
const
KernelRegistration
**
reg
,
bool
*
was_attr_mismatch
)
{
*
reg
=
nullptr
;
*
reg
=
nullptr
;
*
was_attr_mismatch
=
false
;
string
label
;
// Label defaults to empty if not found in NodeDef.
string
label
;
// Label defaults to empty if not found in NodeDef.
GetNodeAttr
(
node_def
,
"_kernel"
,
&
label
);
GetNodeAttr
(
node_def
,
"_kernel"
,
&
label
);
const
string
key
=
Key
(
node_def
.
op
(),
device_type
,
label
);
const
string
key
=
Key
(
node_def
.
op
(),
device_type
,
label
);
...
@@ -728,6 +730,8 @@ Status FindKernelRegistration(DeviceType device_type, const NodeDef& node_def,
...
@@ -728,6 +730,8 @@ Status FindKernelRegistration(DeviceType device_type, const NodeDef& node_def,
ProtoShortDebugString
(
iter
->
second
.
def
),
"'"
);
ProtoShortDebugString
(
iter
->
second
.
def
),
"'"
);
}
}
*
reg
=
&
iter
->
second
;
*
reg
=
&
iter
->
second
;
}
else
{
*
was_attr_mismatch
=
true
;
}
}
}
}
return
Status
::
OK
();
return
Status
::
OK
();
...
@@ -738,12 +742,19 @@ Status FindKernelRegistration(DeviceType device_type, const NodeDef& node_def,
...
@@ -738,12 +742,19 @@ Status FindKernelRegistration(DeviceType device_type, const NodeDef& node_def,
Status
FindKernelDef
(
DeviceType
device_type
,
const
NodeDef
&
node_def
,
Status
FindKernelDef
(
DeviceType
device_type
,
const
NodeDef
&
node_def
,
const
KernelDef
**
def
,
string
*
kernel_class_name
)
{
const
KernelDef
**
def
,
string
*
kernel_class_name
)
{
const
KernelRegistration
*
reg
=
nullptr
;
const
KernelRegistration
*
reg
=
nullptr
;
TF_RETURN_IF_ERROR
(
FindKernelRegistration
(
device_type
,
node_def
,
&
reg
));
bool
was_attr_mismatch
;
TF_RETURN_IF_ERROR
(
FindKernelRegistration
(
device_type
,
node_def
,
&
reg
,
&
was_attr_mismatch
));
if
(
reg
==
nullptr
)
{
if
(
reg
==
nullptr
)
{
return
errors
::
NotFound
(
"No registered '"
,
node_def
.
op
(),
"' OpKernel for "
,
Status
s
=
errors
::
NotFound
(
DeviceTypeString
(
device_type
),
"No registered '"
,
node_def
.
op
(),
"' OpKernel for "
,
" devices compatible with node "
,
DeviceTypeString
(
device_type
),
" devices compatible with node "
,
SummarizeNodeDef
(
node_def
));
SummarizeNodeDef
(
node_def
));
if
(
was_attr_mismatch
)
{
errors
::
AppendToMessage
(
&
s
,
" (OpKernel was found, but attributes didn't match)"
);
}
return
s
;
}
}
if
(
def
!=
nullptr
)
*
def
=
&
reg
->
def
;
if
(
def
!=
nullptr
)
*
def
=
&
reg
->
def
;
if
(
kernel_class_name
!=
nullptr
)
*
kernel_class_name
=
reg
->
kernel_class_name
;
if
(
kernel_class_name
!=
nullptr
)
*
kernel_class_name
=
reg
->
kernel_class_name
;
...
@@ -762,7 +773,9 @@ Status SupportedDeviceTypesForNode(
...
@@ -762,7 +773,9 @@ Status SupportedDeviceTypesForNode(
if
(
s
.
ok
())
{
if
(
s
.
ok
())
{
for
(
const
DeviceType
&
device_type
:
prioritized_types
)
{
for
(
const
DeviceType
&
device_type
:
prioritized_types
)
{
const
KernelRegistration
*
reg
=
nullptr
;
const
KernelRegistration
*
reg
=
nullptr
;
TF_RETURN_IF_ERROR
(
FindKernelRegistration
(
device_type
,
def
,
&
reg
));
bool
was_attr_mismatch
;
TF_RETURN_IF_ERROR
(
FindKernelRegistration
(
device_type
,
def
,
&
reg
,
&
was_attr_mismatch
));
if
(
reg
!=
nullptr
)
device_types
->
push_back
(
device_type
);
if
(
reg
!=
nullptr
)
device_types
->
push_back
(
device_type
);
}
}
}
else
{
}
else
{
...
@@ -800,7 +813,9 @@ Status CreateOpKernel(DeviceType device_type, DeviceBase* device,
...
@@ -800,7 +813,9 @@ Status CreateOpKernel(DeviceType device_type, DeviceBase* device,
// Look up kernel registration.
// Look up kernel registration.
const
KernelRegistration
*
registration
;
const
KernelRegistration
*
registration
;
s
=
FindKernelRegistration
(
device_type
,
node_def
,
&
registration
);
bool
was_attr_mismatch
;
s
=
FindKernelRegistration
(
device_type
,
node_def
,
&
registration
,
&
was_attr_mismatch
);
if
(
!
s
.
ok
())
{
if
(
!
s
.
ok
())
{
errors
::
AppendToMessage
(
&
s
,
" when instantiating "
,
node_def
.
op
());
errors
::
AppendToMessage
(
&
s
,
" when instantiating "
,
node_def
.
op
());
return
s
;
return
s
;
...
@@ -810,6 +825,10 @@ Status CreateOpKernel(DeviceType device_type, DeviceBase* device,
...
@@ -810,6 +825,10 @@ Status CreateOpKernel(DeviceType device_type, DeviceBase* device,
"' OpKernel for "
,
DeviceTypeString
(
device_type
),
"' OpKernel for "
,
DeviceTypeString
(
device_type
),
" devices compatible with node "
,
" devices compatible with node "
,
SummarizeNodeDef
(
node_def
)));
SummarizeNodeDef
(
node_def
)));
if
(
was_attr_mismatch
)
{
errors
::
AppendToMessage
(
&
s
,
" (OpKernel was found, but attributes didn't match)"
);
}
return
s
;
return
s
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录