We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a64b5a commit 90d05bbCopy full SHA for 90d05bb
paddle/fluid/operators/sum_op.cu
@@ -163,8 +163,10 @@ void SumToLoDTensor(const framework::ExecutionContext &context) {
163
for (int i = start; i < in_num; ++i) {
164
if (in_vars[i]->IsType<framework::LoDTensor>()) {
165
auto &in_i = in_vars[i]->Get<framework::LoDTensor>();
166
- in_data.emplace_back(in_i.data<T>());
167
lod_length = in_i.numel();
+ if (lod_length && in_i.IsInitialized()) {
168
+ in_data.emplace_back(in_i.data<T>());
169
+ }
170
} else if (in_vars[i]->IsType<framework::SelectedRows>()) {
171
selectrow_index.push_back(i);
172
}
0 commit comments