未验证 提交 9188571c 编写于 作者: X xiebaiyuan 提交者: GitHub

[mobile][opencl] suite inputs or outputs mismatch,,test=mobile (#2698)

上级 165b02f1
......@@ -62,6 +62,7 @@ void OperatorBase<Dtype>::Run() {
DLOG << "-------------" << type_ << "----------------------------";
vector<string> input_keys = GetInputKeys();
for (const auto key : input_keys) {
if (inputs_.count(key) > 0) {
auto var_vec_in = inputs_.at(key);
for (int i = 0; i < var_vec_in.size(); ++i) {
auto var = this->scope_->FindVar(var_vec_in[i]);
......@@ -74,8 +75,12 @@ void OperatorBase<Dtype>::Run() {
#endif
}
}
} else {
DLOG << "did not find key (" << key << ") in inputs_";
}
}
for (const auto key : GetOutKeys()) {
if (outputs_.count(key) > 0) {
auto var_vec_out = outputs_.at(key);
for (int i = 0; i < var_vec_out.size(); ++i) {
auto var = scope_->FindVar(var_vec_out[i]);
......@@ -88,6 +93,9 @@ void OperatorBase<Dtype>::Run() {
#endif
}
}
} else {
DLOG << "did not find key (" << key << ") in outputs_";
}
}
#endif
}
......@@ -100,28 +108,38 @@ void OperatorBase<GPU_CL>::Run() {
DLOG << "-------------" << type_ << "----------------------------";
vector<string> input_keys = GetInputKeys();
for (const auto key : input_keys) {
if (inputs_.count(key) > 0) {
auto var_vec_in = inputs_.at(key);
for (int i = 0; i < var_vec_in.size(); ++i) {
auto var = scope_->FindVar(var_vec_in[i]);
if (var->IsInitialized() && var->template IsType<framework::CLImage>()) {
if (var->IsInitialized() &&
var->template IsType<framework::CLImage>()) {
const CLImage *cl_image = var->template Get<framework::CLImage>();
if (cl_image) {
DLOG << type_ << " input- " << key << "=" << *cl_image;
}
}
}
} else {
DLOG << "did not find key (" << key << ") in inputs_";
}
}
for (const auto key : GetOutKeys()) {
if (outputs_.count(key) > 0) {
auto var_vec_out = outputs_.at(key);
for (int i = 0; i < var_vec_out.size(); ++i) {
auto var = scope_->FindVar(var_vec_out[i]);
if (var->IsInitialized() && var->template IsType<framework::CLImage>()) {
if (var->IsInitialized() &&
var->template IsType<framework::CLImage>()) {
const CLImage *cl_image = var->template Get<framework::CLImage>();
if (cl_image) {
DLOG << type_ << " output- " << key << "=" << *cl_image;
}
}
}
} else {
DLOG << "did not find key (" << key << ") in outputs_";
}
}
#endif
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册