Skip to content

Commit 135bd58

Browse files
authored
use 1.8paddle log_softmax (#350)
1 parent 7a529cf commit 135bd58

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

paddleslim/dist/dml.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import copy
2020
import paddle.fluid as fluid
21-
import paddle.nn.functional as F
2221

2322

2423
class DML(fluid.dygraph.Layer):
@@ -70,7 +69,7 @@ def kl_loss(self, logits):
7069
cur_kl_loss = 0
7170
for j in range(self.model_num):
7271
if i != j:
73-
x = F.log_softmax(logits[i], axis=1)
72+
x = fluid.layers.log_softmax(logits[i], axis=1)
7473
y = fluid.layers.softmax(logits[j], axis=1)
7574
cur_kl_loss += fluid.layers.kldiv_loss(
7675
x, y, reduction='batchmean')

0 commit comments

Comments
 (0)