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

Method allocate_temp

tensorflow/core/framework/op_kernel.cc:235–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235Status OpKernelConstruction::allocate_temp(DataType type,
236 const TensorShape& shape,
237 Tensor* out_temp) {
238 AllocationAttributes attr;
239 attr.allocation_will_be_logged = true;
240 Tensor new_temp(allocator_, type, shape, attr);
241
242 if (!new_temp.IsInitialized()) {
243 return errors::ResourceExhausted(
244 "OOM when allocating temporary tensor with shape", shape.DebugString());
245 }
246 if (LogMemory::IsEnabled()) {
247 LogMemory::RecordTensorAllocation(
248 def_->name(), LogMemory::OP_KERNEL_CONSTRUCTION_STEP_ID, new_temp);
249 }
250 *out_temp = new_temp;
251 return Status::OK();
252}
253
254Status OpKernelConstruction::allocate_persistent(
255 DataType type, const TensorShape& shape, PersistentTensor* out_persistent,

Callers 15

ComputeAsyncMethod · 0.45
ComputeAsyncMethod · 0.45
operator()Method · 0.45
ComputeMethod · 0.45
TransformNHWCToNCHWFunction · 0.45
launchMethod · 0.45
SetOutputExpressionMethod · 0.45
PopulateOutputsMethod · 0.45
CompileMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45
TEST_FFunction · 0.45

Calls 12

ResourceExhaustedFunction · 0.85
IsEnabledFunction · 0.85
allocate_tensorFunction · 0.85
tensor_dataMethod · 0.80
nameMethod · 0.65
IsInitializedMethod · 0.45
DebugStringMethod · 0.45
okMethod · 0.45
TotalBytesMethod · 0.45
TracksAllocationSizesMethod · 0.45
AllocatedSizeMethod · 0.45
dataMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
ComputeMethod · 0.36
ComputeMethod · 0.36