On this page
tensorflow::TensorBuffer
This is an abstract class.
#include <tensor.h>
Summary
Interface to access the raw ref-counted data buffer.
Inheritance
Inherits from: RefCountedConstructors and Destructors | |
---|---|
TensorBuffer(void *data_ptr) |
|
~TensorBuffer() |
Public functions | |
---|---|
FillAllocationDescription(AllocationDescription *proto) const =0 |
virtual void
Fills metadata about the allocation into the proto.
|
GetAllocatedBytes(size_t *out_bytes) const |
virtual bool
|
OwnsMemory() const |
virtual bool
Whether this TensorBuffer owns the underlying memory.
|
base() const |
T *
Helper method to reinterpret the buffer as an array of T .
|
data() const |
void *
|
root_buffer()=0 |
virtual TensorBuffer *
|
size() const =0 |
virtual size_t
Size (in bytes) of the buffer.
|
Public functions
FillAllocationDescription
virtual void FillAllocationDescription(
AllocationDescription *proto
) const =0
Fills metadata about the allocation into the proto.
GetAllocatedBytes
virtual bool GetAllocatedBytes(
size_t *out_bytes
) const
TensorBuffer
TensorBuffer(
void *data_ptr
)
base
T * base() const
Helper method to reinterpret the buffer as an array of T
.
data
void * data() const
root_buffer
virtual TensorBuffer * root_buffer()=0
If this TensorBuffer is sub-buffer of another TensorBuffer, returns that TensorBuffer.
Otherwise, returns this.
size
virtual size_t size() const =0
Size (in bytes) of the buffer.
~TensorBuffer
~TensorBuffer() override
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/cc/class/tensorflow/tensor-buffer