@@ -69,6 +69,19 @@ static DDim GetDims(const Scope& scope, const std::string& name,
69
69
}
70
70
}
71
71
72
+ static int GetRowSize (const Scope& scope, const std::string& name) {
73
+ Variable* var = scope.FindVar (name);
74
+ if (var == nullptr ) {
75
+ return -1 ;
76
+ }
77
+
78
+ if (var->IsType <SelectedRows>()) {
79
+ return var->Get <SelectedRows>().rows ().size ();
80
+ }
81
+
82
+ return -1 ;
83
+ }
84
+
72
85
static LoD GetLoD (const Scope& scope, const std::string& name) {
73
86
Variable* var = scope.FindVar (name);
74
87
auto default_lod = LoD ({{}});
@@ -153,6 +166,10 @@ std::string OperatorBase::DebugStringEx(const Scope* scope) const {
153
166
for (size_t i = 0 ; i < input.second .size (); ++i) {
154
167
ss << input.second [i];
155
168
if (scope) {
169
+ int row_size = GetRowSize (*scope, input.second [i]);
170
+ if (row_size >= 0 ) {
171
+ ss << " [row_size=" << row_size << " ]" ;
172
+ }
156
173
ss << " [" << GetDims (*scope, input.second [i], true ) << " ]" ;
157
174
ss << " (" << GetLoD (*scope, input.second [i]) << " )" ;
158
175
}
@@ -173,6 +190,10 @@ std::string OperatorBase::DebugStringEx(const Scope* scope) const {
173
190
for (size_t i = 0 ; i < output.second .size (); ++i) {
174
191
ss << output.second [i];
175
192
if (scope) {
193
+ int row_size = GetRowSize (*scope, output.second [i]);
194
+ if (row_size >= 0 ) {
195
+ ss << " [row_size=" << row_size << " ]" ;
196
+ }
176
197
ss << " [" << GetDims (*scope, output.second [i], true ) << " ]" ;
177
198
ss << " (" << GetLoD (*scope, output.second [i]) << " )" ;
178
199
}
0 commit comments