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

Method Compile

tensorflow/compiler/aot/aot_only_var_handle_op.cc:39–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void XlaAotOnlyVarHandleOp::Compile(XlaOpKernelContext* context) {
40 // Look for a resource of the same name. TF also keys that on the container
41 // and type attributes, but that doesn't seem necessary.
42 for (const auto& resource : context->xla_context()->resources()) {
43 if (resource->kind() == XlaResource::kVariable &&
44 resource->name() == name_) {
45 context->SetResourceOutput(0, resource.get());
46 return;
47 }
48 }
49 context->SetStatus(
50 errors::InvalidArgument("Variable: ", name_, " not configured"));
51}
52} // namespace
53
54REGISTER_XLA_OP(Name("VarHandleOp").CompilationOnly(), XlaAotOnlyVarHandleOp);

Callers

nothing calls this directly

Calls 8

InvalidArgumentFunction · 0.85
resourcesMethod · 0.80
xla_contextMethod · 0.80
SetResourceOutputMethod · 0.80
nameMethod · 0.65
kindMethod · 0.45
getMethod · 0.45
SetStatusMethod · 0.45

Tested by

no test coverage detected