\brief Test whether the tensor's storage in TensorArray is allocated. return Whether all tensors in TensorArray is allocated.
| 39 | /// \brief Test whether the tensor's storage in TensorArray is allocated. |
| 40 | /// return Whether all tensors in TensorArray is allocated. |
| 41 | bool TensorArray::initialized() const { |
| 42 | if (tensors_.empty()) { |
| 43 | return false; |
| 44 | } |
| 45 | |
| 46 | for (auto const& tensor : tensors_) { |
| 47 | if (!tensor.has_allocation()) { |
| 48 | return false; |
| 49 | } |
| 50 | } |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | int64_t TensorArray::numel() const { |
| 55 | PADDLE_THROW(errors::Unavailable("numel() can't be used in TensorArray")); |
nothing calls this directly
no test coverage detected