未验证 提交 43dab723 编写于 作者: E emailweixu 提交者: GitHub

Merge pull request #7323 from jacquesqiao/fix-GetDims-bug

fix GetDims bug
......@@ -74,7 +74,9 @@ void UseALL() {
static DDim GetDims(const Scope& scope, const std::string& name) {
Variable* var = scope.FindVar(name);
if (var->IsType<LoDTensor>()) {
if (var == nullptr) {
return DDim({-1});
} else if (var->IsType<LoDTensor>()) {
return var->Get<LoDTensor>().dims();
} else if (var->IsType<SelectedRows>()) {
return var->Get<SelectedRows>().GetCompleteDims();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册