diff --git a/deepxde/data/pde_operator.py b/deepxde/data/pde_operator.py index 9bc5e98d4..85174215b 100644 --- a/deepxde/data/pde_operator.py +++ b/deepxde/data/pde_operator.py @@ -306,8 +306,8 @@ def forward_call(trunk_input): losses_bc.append(losses_i) losses_bc = zip(*losses_bc) - for loss in losses_bc: - losses.append(bkd.reduce_mean(bkd.stack(loss, 0))) + losses_bc = [bkd.reduce_mean(bkd.stack(loss, 0)) for loss in losses_bc] + losses.extend(losses_bc) return losses def losses_train(self, targets, outputs, loss_fn, inputs, model, aux=None):