Created by: liym27
Before this PR, list a
won't be transformed to LoDTensorArray because a
is reassigned with a Tensor fluid.layers.concat(a, axis=0)
. However, a=[]
should be transformed into a=fluid.layers.create_array(dtype="float32")
.
def test_list_in_for_loop_with_concat(x, iter_num):
x = fluid.dygraph.to_variable(x)
a = [] # Before this PR, `a=[]` is not transformed
for i in range(iter_num):
a.append(x)
a = fluid.layers.concat(a, axis=0)
return a