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

Method Compute

tensorflow/core/kernels/scatter_nd_op.cc:244–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 }
243
244 void Compute(OpKernelContext* c) override {
245 if (dtype_ == DT_RESOURCE) {
246 core::RefCountPtr<Var> v;
247 OP_REQUIRES_OK(c, LookupResource(c, HandleFromInput(c, 0), &v));
248 OP_REQUIRES_OK(c, EnsureSparseVariableAccess<Device, T>(c, v.get()));
249 mutex_lock m(*v->mu());
250 DoCompute(c);
251 } else if (use_exclusive_lock_) {
252 // If we're here, it means the input type is a ref.
253 DCHECK(IsRefType(c->input_dtype(0)));
254 // Hold mutex while we apply updates
255 mutex_lock l(*c->input_ref_mutex(0));
256 DoCompute(c);
257 } else {
258 DoCompute(c);
259 }
260 }
261
262 private:
263 DataType dtype_;

Callers

nothing calls this directly

Calls 8

LookupResourceFunction · 0.85
HandleFromInputFunction · 0.85
DoComputeFunction · 0.85
IsRefTypeFunction · 0.85
input_ref_mutexMethod · 0.60
getMethod · 0.45
muMethod · 0.45
input_dtypeMethod · 0.45

Tested by

no test coverage detected