Fix FromPixels type checker to avoid error in worker (#5472)
Fix FromPixels type checker to avoid error in worker (#5472)

* Fix FromPixels type checker to avoid error in worker

TFJS is possible running in worker, which doesn't have
ability to access DOM elements.

FromPixels op in tfjs webgpu backend type check
doesn't consider this scene. It will break the whole
program even if user provided correct input params.

Fix this by checking whether DOM is available.

Bug #5467

* Remove unused checks
tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs,tensorflow/tfjs