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

Function GetDelegates

tensorflow/lite/examples/label_image/label_image.cc:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77TfLiteDelegatePtrMap GetDelegates(Settings* s) {
78 TfLiteDelegatePtrMap delegates;
79 if (s->gl_backend) {
80 auto delegate = CreateGPUDelegate(s);
81 if (!delegate) {
82 LOG(INFO) << "GPU acceleration is unsupported on this platform.";
83 } else {
84 delegates.emplace("GPU", std::move(delegate));
85 }
86 }
87
88 if (s->accel) {
89 auto delegate = evaluation::CreateNNAPIDelegate();
90 if (!delegate) {
91 LOG(INFO) << "NNAPI acceleration is unsupported on this platform.";
92 } else {
93 delegates.emplace("NNAPI", evaluation::CreateNNAPIDelegate());
94 }
95 }
96 return delegates;
97}
98
99// Takes a file name, and loads a list of labels from it, one per line, and
100// returns a vector of the strings. It pads with empty strings so the length

Callers 2

InitMethod · 0.85
RunInferenceFunction · 0.85

Calls 3

CreateNNAPIDelegateFunction · 0.85
CreateGPUDelegateFunction · 0.70
emplaceMethod · 0.45

Tested by

no test coverage detected