| 97 | } // namespace |
| 98 | |
| 99 | TF_Tensor* TF_AllocateTensor(TF_DataType dtype, const int64_t* dims, |
| 100 | int num_dims, size_t len) { |
| 101 | void* data = tensorflow::allocate_tensor("TF_AllocateTensor", len, |
| 102 | tensorflow::cpu_allocator()); |
| 103 | return TF_NewTensor(dtype, dims, num_dims, data, len, |
| 104 | tensorflow::deallocate_buffer, |
| 105 | tensorflow::cpu_allocator()); |
| 106 | } |
| 107 | |
| 108 | TF_Tensor* TF_NewTensor(TF_DataType dtype, const int64_t* dims, int num_dims, |
| 109 | void* data, size_t len, |