提交 55cfc4dd 编写于 作者: X xiebaiyuan 提交者: GitHub

Merge pull request #965 from xiebaiyuan/develop

suit multi inputs and out put . and fix bug when isInitialized check close #964
...@@ -65,16 +65,20 @@ void OperatorBase<Dtype>::Run() const { ...@@ -65,16 +65,20 @@ void OperatorBase<Dtype>::Run() const {
auto var_vec_in = inputs_.at(key); auto var_vec_in = inputs_.at(key);
for (int i = 0; i < var_vec_in.size(); ++i) { for (int i = 0; i < var_vec_in.size(); ++i) {
auto vari = scope_->FindVar(var_vec_in[i]); auto vari = scope_->FindVar(var_vec_in[i]);
Tensor *tensor = vari->template GetMutable<framework::LoDTensor>(); if (vari->IsInitialized()) {
if (tensor) DLOG << type_ << " input- " << key << "=" << *tensor; Tensor *tensor = vari->template GetMutable<framework::LoDTensor>();
if (tensor) DLOG << type_ << " input- " << key << "=" << *tensor;
}
} }
} }
for (const auto key : GetOutKeys()) { for (const auto key : GetOutKeys()) {
auto var_vec_out = outputs_.at(key); auto var_vec_out = outputs_.at(key);
for (int i = 0; i < var_vec_out.size(); ++i) { for (int i = 0; i < var_vec_out.size(); ++i) {
auto vari = scope_->FindVar(var_vec_out[i]); auto vari = scope_->FindVar(var_vec_out[i]);
Tensor *tensor = vari->template GetMutable<framework::LoDTensor>(); if (vari->IsInitialized()) {
if (tensor) DLOG << type_ << " output- " << key << "=" << *tensor; Tensor *tensor = vari->template GetMutable<framework::LoDTensor>();
if (tensor) DLOG << type_ << " output- " << key << "=" << *tensor;
}
} }
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册