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

Method mutable_input

tensorflow/core/framework/op_kernel.cc:404–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404Tensor OpKernelContext::mutable_input(int index, bool lock_held) {
405 CHECK_GE(index, 0);
406 CHECK_LT(index, num_inputs());
407 CHECK(input_is_ref(index));
408 // return a copy of the Ref acquired while holding the mutex
409 if (lock_held) {
410 Tensor& tensor = *((*params_->inputs)[index].tensor);
411 record_tensor_reference(tensor);
412 return tensor;
413 } else {
414 tf_shared_lock l(*input_ref_mutex(index));
415 Tensor& tensor = *((*params_->inputs)[index].tensor);
416 record_tensor_reference(tensor);
417 return tensor;
418 }
419}
420
421void OpKernelContext::replace_ref_input(int index, const Tensor& tensor,
422 bool lock_held) {

Callers 15

RemoveInputAtIndexFunction · 0.45
SparsifyGatherInternalFunction · 0.45
MergeAdjacentRequantizesFunction · 0.45
AddNodeInputFunction · 0.45
RenameNodeInputsFunction · 0.45
TestFindInvalidInputsMethod · 0.45
TestIsGraphValidMethod · 0.45
ReplaceSendRecvsFunction · 0.45
ObfuscateNamesFunction · 0.45
ComputeMethod · 0.45

Calls 2

InvalidArgumentFunction · 0.85
InputRangeMethod · 0.80

Tested by 8

TestFindInvalidInputsMethod · 0.36
TestIsGraphValidMethod · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
SetUpMethod · 0.36
SetUpMethod · 0.36
CompareGraphNodesFunction · 0.36