MCPcopy
hub / github.com/tensorflow/tfjs / findBackend

Method findBackend

tfjs-core/src/engine.ts:235–250  ·  view source on GitHub ↗
(backendName: string)

Source from the content-addressed store, hash-verified

233 }
234
235 findBackend(backendName: string): KernelBackend {
236 if (!(backendName in this.registry)) {
237 // If the backend hasn't been initialized but we have a registry entry for
238 // it, initialize it and return it.
239 if (backendName in this.registryFactory) {
240 const {asyncInit} = this.initializeBackend(backendName);
241 if (asyncInit) {
242 // Backend is not ready yet.
243 return null;
244 }
245 } else {
246 return null;
247 }
248 }
249 return this.registry[backendName];
250 }
251
252 findBackendFactory(backendName: string):
253 () => KernelBackend | Promise<KernelBackend> {

Callers 9

index_test.tsFile · 0.80
findBackendFunction · 0.80
engine_test.tsFile · 0.80
nodeBackendFunction · 0.80
backends_test.tsFile · 0.80
core_test.jsFile · 0.80
getRendererInfoFunction · 0.80

Calls 1

initializeBackendMethod · 0.95

Tested by

no test coverage detected