MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / use_count

Method use_count

src/core/include/megbrain/tensor.h:252–257  ·  view source on GitHub ↗

shortcut for raw_storage().use_count(), but won't trigger lazy alloc

Source from the content-addressed store, hash-verified

250
251 //! shortcut for raw_storage().use_count(), but won't trigger lazy alloc
252 size_t use_count() const {
253 if (m_size > m_capacity) {
254 return 1;
255 }
256 return raw_storage().use_count();
257 }
258
259 //! whether current capacity is 0 (so we are waiting for lazy init)
260 bool has_no_real_storage() const { return !m_capacity; }

Callers 6

defragMethod · 0.80
clear_allMethod · 0.80
assert_destroyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected