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

Method Compute

tensorflow/core/kernels/training_ops.cc:1144–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1142 }
1143
1144 void Compute(OpKernelContext* ctx) override {
1145 Var* var;
1146 const bool sparse = true;
1147 mutex* mu = GetTrainingVariableMutex<CPUDevice, T>(ctx, 0, sparse, &var);
1148 core::ScopedUnref scoped_unref(var);
1149 // mu_accum is actually the same mutex as mu_var since currently we use a
1150 // global mutex.
1151 //
1152 // mutex* mu_accum = ctx->input_ref_mutex(1);
1153 if (use_exclusive_lock_ && mu != nullptr) {
1154 mutex_lock ml(*mu);
1155 DoCompute(ctx);
1156 } else {
1157 DoCompute(ctx);
1158 }
1159 }
1160
1161 void DoCompute(OpKernelContext* ctx) {
1162 Tensor var;

Callers

nothing calls this directly

Calls 1

DoComputeFunction · 0.85

Tested by

no test coverage detected