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

fix GetDims bug
detection_output_fixbug
emailweixu 7 years ago committed by GitHub
commit 43dab723c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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();

Loading…
Cancel
Save