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

Function GetAllocatedBytes

tensorflow/core/framework/dataset.cc:326–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326int64 GetAllocatedBytes(const std::vector<Tensor>& element) {
327 int64 allocated_bytes = 0;
328 DatasetBase* dataset;
329 for (auto& tensor : element) {
330 if (tensor.dtype() == DT_VARIANT &&
331 GetDatasetFromVariantTensor(tensor, &dataset).ok()) {
332 allocated_bytes += dataset->AllocatedBytes();
333 } else {
334 allocated_bytes += tensor.AllocatedBytes();
335 }
336 }
337 return allocated_bytes;
338}
339
340Status GetDatasetFromVariantTensor(const Tensor& tensor,
341 DatasetBase** out_dataset) {

Callers 3

RecordBufferDequeueMethod · 0.85
RecordBufferEnqueueMethod · 0.85
AllocatedBytesMethod · 0.85

Calls 4

dtypeMethod · 0.45
okMethod · 0.45
AllocatedBytesMethod · 0.45

Tested by

no test coverage detected