Notes: The type of Tensor must be Tensor Array.
(self, var)
| 1063 | pass |
| 1064 | |
| 1065 | def append(self, var): |
| 1066 | """ |
| 1067 | Notes: |
| 1068 | The type of Tensor must be Tensor Array. |
| 1069 | |
| 1070 | """ |
| 1071 | if not self.is_dense_tensor_array_type(): |
| 1072 | raise TypeError( |
| 1073 | f"Only Tensor with DenseTensorArray support `append` method, but received {self}" |
| 1074 | ) |
| 1075 | from paddle.tensor.array import array_length, array_write |
| 1076 | |
| 1077 | array_write(x=var, i=array_length(self), array=self) |
| 1078 | |
| 1079 | def pop(self, *args): |
| 1080 | """ |