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

Method IsUsefulToSwap

tensorflow/core/kernels/stack.cc:82–89  ·  view source on GitHub ↗

We don't swap the first tensor on the stack and any subsequent tensors that share the buffer with the first tensor.

Source from the content-addressed store, hash-verified

80 // We don't swap the first tensor on the stack and any subsequent tensors
81 // that share the buffer with the first tensor.
82 bool IsUsefulToSwap(const Tensor& tensor) const {
83 mutex_lock l(mu_);
84 if (stack_.empty()) {
85 return false;
86 }
87 const Tensor& first = stack_.front().tensor;
88 return !tensor.SharesBufferWith(first);
89 }
90
91 void Close() {
92 mutex_lock l(mu_);

Callers 1

ComputeAsyncMethod · 0.80

Calls 3

emptyMethod · 0.45
frontMethod · 0.45
SharesBufferWithMethod · 0.45

Tested by

no test coverage detected