init_array = tf.TensorArray( # TensorArray可以看做是具有动态size功能的Tensor数组。通常和while_loop或map_fn一起使用。 dtype, # dtype: (必需)TensorArray的数据类型。 size=None, # TensorArray的大小 dynamic_size=None, # dynamic_size:如果为真,大小可变。默认值:False。 clear_after_read=None, # clear_after_read:这个参数,默认为True,这种情况下数组中某个tensor读一次之后就被清除了. tensor_array_name=None, handle=None, flow=None, infer_shape=True, element_shape=None, colocate_with_first_write_call=True, name=None) # 返回:TensorArray中的所有张量都连接成的一个张量。
init_array = init_array.write(index,value,name=None) # 将value写入指定位置
tf.TensorArray
猜你喜欢
转载自blog.csdn.net/lzbmc/article/details/88914464
今日推荐
周排行