LoDTensorArray_cn.rst 721 字节
Newer Older
H
Hao Wang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
.. _cn_api_fluid_LoDTensorArray:

LoDTensorArray
-------------------------------

.. py:class:: paddle.fluid.LoDTensorArray

LoDTensor的数组。

**示例代码**

.. code-block:: python
        
        import paddle.fluid as fluid
     
        arr = fluid.LoDTensorArray()   

.. py:method:: append(self: paddle.fluid.core_avx.LoDTensorArray, tensor: paddle.fluid.core.LoDTensor) → None

将LoDTensor追加到LoDTensorArray后。

**示例代码**

.. code-block:: python

            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)