未验证 提交 afeb394e 编写于 作者: L liu zhengxi 提交者: GitHub

update (#49155)

上级 cc7ed645
...@@ -29,6 +29,7 @@ from paddle.nn import Layer ...@@ -29,6 +29,7 @@ from paddle.nn import Layer
from paddle.nn import functional as F from paddle.nn import functional as F
from paddle.nn import initializer as I from paddle.nn import initializer as I
from paddle.static import Variable, default_startup_program, program_guard from paddle.static import Variable, default_startup_program, program_guard
from paddle.tensor.manipulation import tensor_array_to_tensor
from .container import LayerList from .container import LayerList
...@@ -319,14 +320,10 @@ def _rnn_static_graph( ...@@ -319,14 +320,10 @@ def _rnn_static_graph(
new_cond = paddle.tensor.less_than(start_i, end) new_cond = paddle.tensor.less_than(start_i, end)
paddle.fluid.layers.assign(new_cond, cond) paddle.fluid.layers.assign(new_cond, cond)
out, _ = paddle.fluid.layers.tensor_array_to_tensor( out, _ = tensor_array_to_tensor(out_array, axis=0, use_stack=True)
out_array, axis=0, use_stack=True
)
all_state = map_structure( all_state = map_structure(
lambda x: paddle.fluid.layers.tensor_array_to_tensor( lambda x: tensor_array_to_tensor(x, axis=0, use_stack=True)[0],
x, axis=0, use_stack=True
)[0],
init_array, init_array,
) )
final_outputs = out final_outputs = out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册