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

Function TF_AllocateOutput

tensorflow/c/kernels.cc:245–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245TF_Tensor* TF_AllocateOutput(TF_OpKernelContext* context, int index,
246 TF_DataType dtype, int64_t* dims, int num_dims,
247 size_t len) {
248 auto* cc_ctx = reinterpret_cast<::tensorflow::OpKernelContext*>(context);
249 tensorflow::AllocatorAttributes attr = cc_ctx->output_alloc_attr(index);
250 auto* allocator = cc_ctx->get_allocator(attr);
251 void* data = tensorflow::allocate_tensor("TF_AllocateOutput", len, allocator);
252 return TF_NewTensor(dtype, dims, num_dims, data, len,
253 tensorflow::deallocate_buffer, allocator);
254}

Callers 1

TEST_FFunction · 0.85

Calls 4

allocate_tensorFunction · 0.85
TF_NewTensorFunction · 0.85
output_alloc_attrMethod · 0.80
get_allocatorMethod · 0.80

Tested by 1

TEST_FFunction · 0.68