提交 9573256f 编写于 作者: Y yangyaming

Remove main_program and startup_program.

上级 2a058b10
...@@ -764,7 +764,7 @@ def conv2d_transpose(input, ...@@ -764,7 +764,7 @@ def conv2d_transpose(input,
return out return out
def sequence_expand(x, y, main_program=None, startup_program=None): def sequence_expand(x, y):
"""Sequence Expand Layer. This layer will expand the input variable **x** """Sequence Expand Layer. This layer will expand the input variable **x**
according to LoD information of **y**. And the following examples will according to LoD information of **y**. And the following examples will
explain how sequence_expand works: explain how sequence_expand works:
...@@ -808,8 +808,6 @@ def sequence_expand(x, y, main_program=None, startup_program=None): ...@@ -808,8 +808,6 @@ def sequence_expand(x, y, main_program=None, startup_program=None):
Args: Args:
x (Variable): The input variable which is a Tensor or LoDTensor. x (Variable): The input variable which is a Tensor or LoDTensor.
y (Variable): The input variable which is a LoDTensor. y (Variable): The input variable which is a LoDTensor.
main_program (Program): The main program.
startup_program (Program): The startup program.
Returns: Returns:
Variable: The expanded variable which is a LoDTensor. Variable: The expanded variable which is a LoDTensor.
...@@ -836,9 +834,7 @@ def lstm_unit(x_t, ...@@ -836,9 +834,7 @@ def lstm_unit(x_t,
cell_t_prev, cell_t_prev,
forget_bias=0.0, forget_bias=0.0,
param_attr=None, param_attr=None,
bias_attr=None, bias_attr=None):
main_program=None,
startup_program=None):
"""Lstm unit layer. The equation of a lstm step is: """Lstm unit layer. The equation of a lstm step is:
.. math:: .. math::
...@@ -881,8 +877,6 @@ def lstm_unit(x_t, ...@@ -881,8 +877,6 @@ def lstm_unit(x_t,
initializer, name etc. initializer, name etc.
bias_attr (ParamAttr): The attributes of bias weights, if not False, bias_attr (ParamAttr): The attributes of bias weights, if not False,
bias weights will be created and be set to default value. bias weights will be created and be set to default value.
main_program (Program): The main program.
startup_program (Program): the startup program.
Returns: Returns:
tuple: The hidden value and cell value of lstm unit. tuple: The hidden value and cell value of lstm unit.
...@@ -923,18 +917,11 @@ def lstm_unit(x_t, ...@@ -923,18 +917,11 @@ def lstm_unit(x_t,
bias_attr = ParamAttr() bias_attr = ParamAttr()
size = cell_t_prev.shape[1] size = cell_t_prev.shape[1]
concat_out = concat( concat_out = concat(input=[x_t, hidden_t_prev], axis=1)
input=[x_t, hidden_t_prev],
axis=1,
main_program=main_program,
startup_program=startup_program)
fc_out = fc(input=concat_out, fc_out = fc(input=concat_out,
size=4 * size, size=4 * size,
param_attr=param_attr, param_attr=param_attr,
bias_attr=bias_attr, bias_attr=bias_attr)
act='linear',
main_program=main_program,
startup_program=startup_program)
dtype = x_t.dtype dtype = x_t.dtype
c = helper.create_tmp_variable(dtype) c = helper.create_tmp_variable(dtype)
h = helper.create_tmp_variable(dtype) h = helper.create_tmp_variable(dtype)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册