array_write

    • 参数:
      • i (Variable) – shape为[1]的1-D Tensor,表示写入到输出数组LoDTensorArray的位置,数据类型为int64
      • array (Variable,可选) – 指定写入 x 的数组LoDTensorArray。默认值为None, 此时将创建新的LoDTensorArray并作为结果返回
    1. 1570533133 The content of i-th LoDTensor: The place is:CPUPlace
    2. Tensor[array_read_0.tmp_0]
    3. dtype: l
    4. data: 5,5,5,5,5,5,
    5. #返回了shape为[3,2]的Tensor,即为上面写入的tmp
    6. #dtype为对应C++数据类型,在不同环境下可能显示值不同,但本质一致
    7. # 其在MacOS下为'x',linux下为'l',Windows下为'__int64',都表示64位整型变量