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

Method allocate_output

tensorflow/core/framework/op_kernel.cc:659–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659Status OpKernelContext::allocate_output(int index, const TensorShape& shape,
660 Tensor** tensor) {
661 if (index < 0) {
662 return errors::Internal("allocate_output with bad index=", index,
663 " kernel=", params_->op_kernel->name());
664 }
665 if (index >= num_outputs()) {
666 return errors::Internal("allocate_output with bad index=", index,
667 " num_outputs=", num_outputs(),
668 " kernel=", params_->op_kernel->name());
669 }
670 bool forward_expected =
671 (params_->forward_from_array != nullptr && index >= 0 &&
672 params_->forward_from_array[index] >= 0);
673 if (forward_expected) {
674 return errors::Internal(
675 "Explicit allocate_output call where input forwarding required. Try "
676 "turning off the ScopedAllocator optimizer.");
677 }
678 AllocatorAttributes attr = output_alloc_attr(index);
679 return allocate_output(index, shape, tensor, attr);
680}
681
682Status OpKernelContext::allocate_output(StringPiece name,
683 const TensorShape& shape,

Callers 15

ComputeAsyncMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeAsyncMethod · 0.80
ComputeAsyncMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeAsyncMethod · 0.80

Calls 13

InternalFunction · 0.85
InvalidArgumentFunction · 0.85
IsRefTypeFunction · 0.85
allocate_tensorFunction · 0.85
TensorValueClass · 0.85
OutputRangeMethod · 0.80
nameMethod · 0.65
sizeMethod · 0.45
output_typeMethod · 0.45
insertMethod · 0.45
getMethod · 0.45
okMethod · 0.45

Tested by 15

ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
DoBroadcastMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64
ComputeMethod · 0.64