File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,9 @@ void UseALL() {
74
74
75
75
static DDim GetDims (const Scope& scope, const std::string& name) {
76
76
Variable* var = scope.FindVar (name);
77
- if (var->IsType <LoDTensor>()) {
77
+ if (var && var ->IsType <LoDTensor>()) {
78
78
return var->Get <LoDTensor>().dims ();
79
- } else if (var->IsType <SelectedRows>()) {
79
+ } else if (var && var ->IsType <SelectedRows>()) {
80
80
return var->Get <SelectedRows>().GetCompleteDims ();
81
81
} else {
82
82
return DDim ({-1 });
@@ -123,7 +123,7 @@ std::string OperatorBase::DebugStringEx(const Scope* scope) const {
123
123
ss << input.first << " [" ;
124
124
for (size_t i = 0 ; i < input.second .size (); ++i) {
125
125
ss << input.second [i];
126
- if (scope && scope-> FindVar (input. second [i]) ) {
126
+ if (scope) {
127
127
ss << " (" << GetDims (*scope, input.second [i]) << " )" ;
128
128
}
129
129
if (i != input.second .size () - 1 ) {
You can’t perform that action at this time.
0 commit comments