Tfjs-node + webgl backend

Hi all,

In my project, I bundle some code as a client-side library which imports the webgl backend (i.e. import @tensorflow/tfjs-backend-webgl;). Separately, I have some unit tests (using Jest) which import the node backend (i.e. import "@tensorflow/tfjs-node;). These tests import the files which import webgl backend.

When running the tests, I get the kernel warnings for webgl already being registered, e.g.:

The kernel 'ZerosLike' for backend 'webgl' is already registered

Functionally, everything seems to work fine, it’s simply that this double-register warning is there.

So, what is the proper method of including a backend for the client-side code while being able to test using the node backend with double registering the client-side backend? Perhaps a more general question is, is it possible to use both tfjs-node and a backend without getting this double-register warning?