• Registers a global backend. The registration should happen when importing a module file (e.g. when importing backend_webgl.ts), and is used for modular builds (e.g. custom tfjs bundle with only webgl support).

    Parameters

    • name: string
    • factory: (() => KernelBackend | Promise<KernelBackend>)

      The backend factory function. When called, it should return a backend instance, or a promise of an instance.

    • Optional priority: number

      The priority of the backend (higher = more important). In case multiple backends are registered, the priority is used to find the best backend. Defaults to 1.

    Returns boolean

    False if there is already a registered backend under this name, true if not.

    Doc

Generated using TypeDoc