未验证 提交 bf9ed4a9 编写于 作者: E emailweixu 提交者: GitHub

Merge pull request #8499 from yu239/develop

fix a bug of sub() in layer_math.py
...@@ -75,7 +75,7 @@ LayerOutput.__add__ = add ...@@ -75,7 +75,7 @@ LayerOutput.__add__ = add
def sub(layeroutput, other): def sub(layeroutput, other):
if is_compatible_with(other, float): if is_compatible_with(other, float):
return slope_intercept_layer(input=layeroutput, intercept=other) return slope_intercept_layer(input=layeroutput, intercept=-other)
if not isinstance(other, LayerOutput): if not isinstance(other, LayerOutput):
logger.fatal("LayerOutput can only be subtracted with" logger.fatal("LayerOutput can only be subtracted with"
" another Layeroutput or a number") " another Layeroutput or a number")
......
...@@ -230,7 +230,7 @@ layers { ...@@ -230,7 +230,7 @@ layers {
input_layer_name: "__mixed_1__" input_layer_name: "__mixed_1__"
} }
slope: 1.0 slope: 1.0
intercept: 2 intercept: -2
} }
layers { layers {
name: "__slope_intercept_layer_4__" name: "__slope_intercept_layer_4__"
...@@ -411,4 +411,3 @@ sub_models { ...@@ -411,4 +411,3 @@ sub_models {
output_layer_names: "__mixed_3__" output_layer_names: "__mixed_3__"
is_recurrent_layer_group: false is_recurrent_layer_group: false
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册