diff options
author | 2017-07-27 14:27:32 -0700 | |
---|---|---|
committer | 2017-07-27 14:31:43 -0700 | |
commit | 22651083406ca01ac9d481e3367a3510d25f88cd (patch) | |
tree | bda0f3289d50f383eb1e632a595ab97258e35162 /tensorflow/c/c_api.h | |
parent | 613bf1c7c1f8dfceed34fc85f2c71dd00432651e (diff) |
C API: Groundwork for experimenting with TF_Tensor in device memory.
TF_Tensor objects are always backed by host memory. This commit lays
the groundwork for allowing TF_Tensor objects to refer to tensor data
on device (e.g., GPU) memory.
PiperOrigin-RevId: 163388079
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r-- | tensorflow/c/c_api.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h index 46758408c4..715fe57656 100644 --- a/tensorflow/c/c_api.h +++ b/tensorflow/c/c_api.h @@ -263,6 +263,9 @@ TF_CAPI_EXPORT extern int64_t TF_Dim(const TF_Tensor* tensor, int dim_index); TF_CAPI_EXPORT extern size_t TF_TensorByteSize(const TF_Tensor*); // Return a pointer to the underlying data buffer. +// +// Returns NULL if the underlying data is not in host memory +// (for example, if it refers to addresses in GPU memory). TF_CAPI_EXPORT extern void* TF_TensorData(const TF_Tensor*); // -------------------------------------------------------------------------- |