提交 aca53535 编写于 作者: H Hongyu Liu 提交者: Jiabin Yang

fix bug; test=develop (#17733)

上级 0a02451e
......@@ -1461,8 +1461,8 @@ class GRUUnit(layers.Layer):
sigmoid=1,
tanh=2,
relu=3, )
activation = activation_dict[activation]
gate_activation = activation_dict[gate_activation]
self.activation = activation_dict[activation]
self.gate_activation = activation_dict[gate_activation]
self._dtype = dtype
size = size // 3
......@@ -1494,8 +1494,8 @@ class GRUUnit(layers.Layer):
'Hidden': updated_hidden,
},
attrs={
'activation': 2, # tanh
'gate_activation': 1, # sigmoid
'activation': self.activation,
'gate_activation': self.gate_activation,
})
return updated_hidden, reset_hidden_pre, gate
......@@ -2053,7 +2053,7 @@ class Conv2DTranspose(layers.Layer):
self._filter_size = [filter_size_h, filter_size_w]
else:
self._filter_size = utils.convert_to_list(
self._output_size, 2, 'conv2d_transpose.filter_size')
self._filter_size, 2, 'conv2d_transpose.filter_size')
if self._output_size is None:
self._output_size = []
......
......@@ -42,7 +42,9 @@ def monkey_patch_variable():
'shape': shape,
'value': value,
'force_cpu': force_init_on_cpu()
})
},
stop_gradient=True)
var.stop_gradient = True
return var
def create_scalar(block, value, dtype):
......@@ -68,7 +70,10 @@ def monkey_patch_variable():
'value': value,
'input_dim_idx': batch_dim,
'output_dim_idx': batch_dim
})
},
stop_gradient=True)
var.stop_gradient = True
return var
def astype(self, dtype):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册