LoDTensorArray

class paddle.fluid.LoDTensorArray

LoDTensorArray is array of LoDTensor, it supports operator[], len() and for-loop iteration.

Examples

import paddle.fluid as fluid

arr = fluid.LoDTensorArray()
append(self: paddle.fluid.core_avx.LoDTensorArray, tensor: paddle.fluid.core_avx.LoDTensor) → None

Append a LoDensor to LoDTensorArray.

Parameters

tensor (LoDTensor) – The LoDTensor to be appended.

Returns

None.

Examples

import paddle.fluid as fluid
import numpy as np

arr = fluid.LoDTensorArray()
t = fluid.LoDTensor()
t.set(np.ndarray([5, 30]), fluid.CPUPlace())
arr.append(t)