MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RefCountIsOne

Method RefCountIsOne

tensorflow/core/framework/tensor.cc:753–756  ·  view source on GitHub ↗

Notice that buf_ either points to a regular TensorBuffer or a SubBuffer. For the latter case, we have to make sure that the refcount is one both for the SubBuffer _and_ the underlying TensorBuffer.

Source from the content-addressed store, hash-verified

751// For the latter case, we have to make sure that the refcount is
752// one both for the SubBuffer _and_ the underlying TensorBuffer.
753bool Tensor::RefCountIsOne() const {
754 return buf_ != nullptr && buf_->RefCountIsOne() &&
755 buf_->root_buffer()->RefCountIsOne() && buf_->OwnsMemory();
756}
757
758// The macro CASES() expands to a switch statement conditioned on
759// TYPE_ENUM. Each case expands the STMTS after a typedef for T.

Callers 11

forward_inputMethod · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
EagerKernelExecuteFunction · 0.45
AddFunctionDefMethod · 0.45
RemoveFunctionMethod · 0.45
CopyElementToSliceFunction · 0.45
MaybeMoveSliceToElementFunction · 0.45
TF_TensorMaybeMoveFunction · 0.45

Calls 2

root_bufferMethod · 0.45
OwnsMemoryMethod · 0.45

Tested by 2

TESTFunction · 0.36
TEST_FFunction · 0.36