aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/scatter_nd_op.cc
diff options
context:
space:
mode:
authorGravatar Akshay Modi <nareshmodi@google.com>2018-06-11 15:04:30 -0700
committerGravatar Akshay Modi <nareshmodi@google.com>2018-06-11 15:04:30 -0700
commit6d9c0ba224f5903375ae26f582ef233740477e29 (patch)
treebfcaef48a56c6d3900d1db5a248e9d9f155c48e1 /tensorflow/core/kernels/scatter_nd_op.cc
parenta4b390bffbcb01d8f57f25c007277d457f752a69 (diff)
parentab51450c817674c8ff08a7ae4f8ac50cdc4bed8b (diff)
Merge commit for internal changes
Diffstat (limited to 'tensorflow/core/kernels/scatter_nd_op.cc')
-rw-r--r--tensorflow/core/kernels/scatter_nd_op.cc20
1 files changed, 5 insertions, 15 deletions
diff --git a/tensorflow/core/kernels/scatter_nd_op.cc b/tensorflow/core/kernels/scatter_nd_op.cc
index 7b02f46199..e1fc2ea128 100644
--- a/tensorflow/core/kernels/scatter_nd_op.cc
+++ b/tensorflow/core/kernels/scatter_nd_op.cc
@@ -143,14 +143,10 @@ class ScatterNdUpdateOp : public OpKernel {
void Compute(OpKernelContext* c) override {
if (dtype_ == DT_RESOURCE) {
- if (use_exclusive_lock_) {
- Var* v;
- OP_REQUIRES_OK(c, LookupResource(c, HandleFromInput(c, 0), &v));
- mutex_lock m(*v->mu());
- DoCompute(c);
- } else {
- DoCompute(c);
- }
+ Var* v;
+ OP_REQUIRES_OK(c, LookupResource(c, HandleFromInput(c, 0), &v));
+ mutex_lock m(*v->mu());
+ DoCompute(c);
} else if (use_exclusive_lock_) {
// If we're here, it means the input type is a ref.
DCHECK(IsRefType(c->input_dtype(0)));
@@ -176,13 +172,7 @@ class ScatterNdUpdateOp : public OpKernel {
Var* v;
OP_REQUIRES_OK(c, LookupResource(c, HandleFromInput(c, 0), &v));
Tensor* t = v->tensor();
- if (!use_exclusive_lock_) {
- // We're not holding the lock in the outer scope so need it here.
- mutex_lock m(*v->mu());
- OP_REQUIRES_OK(c, PrepareToUpdateVariable<Device, T>(c, t));
- } else {
- OP_REQUIRES_OK(c, PrepareToUpdateVariable<Device, T>(c, t));
- }
+ OP_REQUIRES_OK(c, PrepareToUpdateVariable<Device, T>(c, t));
params = *t;
params_shape = params.shape();
} else if (IsRefType(c->input_dtype(0))) {