From 135bd58212df763438644446a4ddd8fd39543fc9 Mon Sep 17 00:00:00 2001 From: Bai Yifan Date: Mon, 15 Jun 2020 14:03:24 +0800 Subject: [PATCH] use 1.8paddle log_softmax (#350) --- paddleslim/dist/dml.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddleslim/dist/dml.py b/paddleslim/dist/dml.py index 34ae1deb..2ad1c942 100755 --- a/paddleslim/dist/dml.py +++ b/paddleslim/dist/dml.py @@ -18,7 +18,6 @@ from __future__ import print_function import copy import paddle.fluid as fluid -import paddle.nn.functional as F class DML(fluid.dygraph.Layer): @@ -70,7 +69,7 @@ class DML(fluid.dygraph.Layer): cur_kl_loss = 0 for j in range(self.model_num): if i != j: - x = F.log_softmax(logits[i], axis=1) + x = fluid.layers.log_softmax(logits[i], axis=1) y = fluid.layers.softmax(logits[j], axis=1) cur_kl_loss += fluid.layers.kldiv_loss( x, y, reduction='batchmean') -- GitLab