message: Obtain use_locking for resource variables in scatter_nd_add.
diff: @@ -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);
  - }
  } 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));
  - }
  params = *t;
  params_shape = params.shape();
  } else if (IsRefType(c->input_dtype(0))) {
  