Skip to content

Commit

Permalink
fix GetDims bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesqiao committed Jan 8, 2018
1 parent 6e3cc0c commit 8b1a81a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paddle/framework/operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8b1a81a

Please sign in to comment.