MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / initialized

Method initialized

paddle/phi/core/tensor_array.cc:41–52  ·  view source on GitHub ↗

\brief Test whether the tensor's storage in TensorArray is allocated. return Whether all tensors in TensorArray is allocated.

Source from the content-addressed store, hash-verified

39/// \brief Test whether the tensor's storage in TensorArray is allocated.
40/// return Whether all tensors in TensorArray is allocated.
41bool 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
54int64_t TensorArray::numel() const {
55 PADDLE_THROW(errors::Unavailable("numel() can't be used in TensorArray"));

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
has_allocationMethod · 0.45

Tested by

no test coverage detected