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

Function ResourcesVector

tensorflow/compiler/jit/kernels/xla_ops.cc:429–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429std::vector<int> ResourcesVector(OpKernelConstruction* ctx) {
430 DataTypeVector constant_types;
431 OP_REQUIRES_OK_RETURN(ctx, std::vector<int>(),
432 ctx->GetAttr("Tconstants", &constant_types));
433
434 DataTypeVector arg_types;
435 OP_REQUIRES_OK_RETURN(ctx, std::vector<int>(),
436 ctx->GetAttr("Targs", &arg_types));
437
438 int num_resources;
439 OP_REQUIRES_OK_RETURN(ctx, std::vector<int>(),
440 ctx->GetAttr("Nresources", &num_resources));
441
442 std::vector<int> resources(num_resources);
443 std::iota(resources.begin(), resources.end(),
444 constant_types.size() + arg_types.size());
445 return resources;
446}
447
448NameAttrList FunctionAttr(OpKernelConstruction* ctx) {
449 const NameAttrList* func;

Callers 2

XlaLocalLaunchOpMethod · 0.85
XlaCompileOpMethod · 0.85

Calls 4

GetAttrMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected