| 419 | } |
| 420 | |
| 421 | void OpKernelContext::replace_ref_input(int index, const Tensor& tensor, |
| 422 | bool lock_held) { |
| 423 | CHECK_GE(index, 0); |
| 424 | CHECK_LT(index, num_inputs()); |
| 425 | CHECK(input_is_ref(index)); |
| 426 | // should only modify the tensor while holding the mutex |
| 427 | if (lock_held) { |
| 428 | *(*params_->inputs)[index].tensor = tensor; |
| 429 | } else { |
| 430 | mutex_lock l(*input_ref_mutex(index)); |
| 431 | *(*params_->inputs)[index].tensor = tensor; |
| 432 | } |
| 433 | record_tensor_reference(tensor); |
| 434 | } |
| 435 | |
| 436 | void OpKernelContext::forward_ref_input_to_ref_output(int input_index, |
| 437 | int output_index) { |
no test coverage detected