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

Function TF_AllocateTensor

tensorflow/c/tf_tensor.cc:99–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97} // namespace
98
99TF_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
108TF_Tensor* TF_NewTensor(TF_DataType dtype, const int64_t* dims, int num_dims,
109 void* data, size_t len,

Callers 15

TFE_Py_TensorShapeSliceFunction · 0.85
SetTensorProtoFunction · 0.85
TF_TensorFromTensorFunction · 0.85
Int8TensorFunction · 0.85
Int32TensorFunction · 0.85
TESTFunction · 0.85
FloatTensor2x2Method · 0.85
TestScalarTensorHandleFunction · 0.85

Calls 3

allocate_tensorFunction · 0.85
cpu_allocatorFunction · 0.85
TF_NewTensorFunction · 0.85

Tested by 15

SetTensorProtoFunction · 0.68
Int8TensorFunction · 0.68
Int32TensorFunction · 0.68
TESTFunction · 0.68
FloatTensor2x2Method · 0.68
TestScalarTensorHandleFunction · 0.68
TestMatrixTensorHandleFunction · 0.68
TestAxisTensorHandleFunction · 0.68