提交 2128f5f7 编写于 作者: C channingss

[ONNX]fix bug for InstanceNormalization

上级 cf0a8177
...@@ -30,16 +30,13 @@ def InstanceNormalization_layer(inputs, name=None): ...@@ -30,16 +30,13 @@ def InstanceNormalization_layer(inputs, name=None):
if name is not None: if name is not None:
scale_name = name + "_scale" scale_name = name + "_scale"
offset_name = name + "_offset" offset_name = name + "_offset"
scale_param = fluid.ParamAttr(name=scale_name,
initializer=fluid.initializer.Constant(1.0), scale_param = inputs[1]
trainable=True) offset_param = inputs[2]
offset_param = fluid.ParamAttr(name=offset_name, scale = fluid.layers.create_parameter(name=scale_param.name,
initializer=fluid.initializer.Constant(0.0),
trainable=True)
scale = fluid.layers.create_parameter(attr=scale_param,
shape=input_.shape[1:2], shape=input_.shape[1:2],
dtype="float32") dtype="float32")
offset = fluid.layers.create_parameter(attr=offset_param, offset = fluid.layers.create_parameter(name=offset_param.name,
shape=input_.shape[1:2], shape=input_.shape[1:2],
dtype="float32") dtype="float32")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册