\brief Test whether the holder is created. \return Whether the holder is created.
| 24 | /// \brief Test whether the holder is created. |
| 25 | /// \return Whether the holder is created. |
| 26 | bool TensorArray::has_allocation() const { |
| 27 | if (tensors_.empty()) { |
| 28 | return false; |
| 29 | } |
| 30 | |
| 31 | for (auto const& tensor : tensors_) { |
| 32 | if (!tensor.has_allocation()) { |
| 33 | return false; |
| 34 | } |
| 35 | } |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | /// \brief Test whether the tensor's storage in TensorArray is allocated. |
| 40 | /// return Whether all tensors in TensorArray is allocated. |
no test coverage detected