Skip to content

Commit 6732836

Browse files
committed
[pl] train_pl: minor fix of statement order.
1 parent 1c8e29e commit 6732836

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/train_pl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ def validation_step(self, data, batch_idx):
149149
n_predictions = []
150150

151151
loss = torch.tensor(0)
152+
153+
tmp = [data['fc_feats'], data['att_feats'],
154+
data['labels'], data['masks'], data['att_masks']]
155+
fc_feats, att_feats, labels, masks, att_masks = tmp
152156
if data.get('labels', None) is not None and verbose_loss:
153157
# forward the model to get loss
154-
tmp = [data['fc_feats'], data['att_feats'],
155-
data['labels'], data['masks'], data['att_masks']]
156-
fc_feats, att_feats, labels, masks, att_masks = tmp
157-
158158
loss = crit(model(fc_feats, att_feats,
159159
labels[..., :-1], att_masks), labels[..., 1:], masks[..., 1:])
160160

0 commit comments

Comments
 (0)