From 34a440fa646ea9627efc2be27c6efbb51642dfe2 Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Thu, 29 Mar 2018 17:26:49 +0800 Subject: [PATCH] Revert "make append activation in place by default (#9417)" This reverts commit ce16400daedfa8f793d20d44081db7f417af693a. --- python/paddle/fluid/layer_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/layer_helper.py b/python/paddle/fluid/layer_helper.py index 4341e065968..d771837fc54 100644 --- a/python/paddle/fluid/layer_helper.py +++ b/python/paddle/fluid/layer_helper.py @@ -398,6 +398,7 @@ class LayerHelper(object): return input_var if isinstance(act, basestring): act = {'type': act} + tmp = self.create_tmp_variable(dtype=input_var.dtype) if 'use_mkldnn' in self.kwargs: act['use_mkldnn'] = self.kwargs.get('use_mkldnn') @@ -407,9 +408,9 @@ class LayerHelper(object): self.append_op( type=act_type, inputs={"X": [input_var]}, - outputs={"Out": [input_var]}, + outputs={"Out": [tmp]}, attrs=act) - return input_var + return tmp def _get_default_initializer(self, dtype): if dtype is None or dtype_is_floating(dtype) is True: -- GitLab