title: failed to compile fragment shader when using tensorflow on Angular
body: <p>I am trying to implement transfer learning on an angular application. For the collection of new data, I thought I'll just use the exact same code from the tutorial on tensorflow js, the one used on the pacman game. </p>
  
  <p>This is the code of the controller_dataset.js from the tensorflow.js tutorial. I imported this on a component on angular.</p>
  
  <pre><code>import * as tf from '@tensorflow/tfjs';
  
  
  export class ControllerDataset {
      constructor(numClasses) {
        this.numClasses = numClasses;
      }
  
  
     addExample(example, label) {
  
      const y = tf.tidy(() =&gt; tf.oneHot(tf.tensor1d([label]).toInt(), this.numClasses));
  
      if (this.xs == null) {
        this.xs = tf.keep(example);
        this.ys = tf.keep(y);
      } else {
        const oldX = this.xs;
        this.xs = tf.keep(oldX.concat(example, 0));
  
        const oldY = this.ys;
        this.ys = tf.keep(oldY.concat(y, 0));
  
        oldX.dispose();
        oldY.dispose();
        y.dispose();
      }
    }
  }
  </code></pre>
  
  <p>The problem is that when the controller.addExample is called it results in the following error </p>
  
  <pre><code>ERROR Error: Failed to compile fragment shader.
  at createFragmentShader (tf-core.esm.js:17)
  at e.createProgram (tf-core.esm.js:17)
  at compileProgram (tf-core.esm.js:17)
  at tf-core.esm.js:17
  at e.getAndSaveBinary (tf-core.esm.js:17)
  at e.compileAndRun (tf-core.esm.js:17)
  at e.oneHot (tf-core.esm.js:17)
  at ENV.engine.runKernel.indices (tf-core.esm.js:17)
  at e.runKernel (tf-core.esm.js:17)
  at e.oneHot (tf-core.esm.js:17)
  </code></pre>