Tensorflow.js load latest API and find/display the version

Working on Tensorflow.js API and wanted to find out how to accomplish the following:
  1. Load the latest Tensorflow.js API without recourse to the version number.
  2. Find out or print out the version of the library loaded.
On the surface - these tasks look pretty simple and should not be any biggies but as usual, the Devil is in the details. Unfurtunately, I could not find any easy reference to accomplish them. Anyway, without much ado - following these steps would get you to El Dorado:
  1. <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis@1.0.2/dist/tfjs-vis.umd.min.js"> </script>
  2. Add an event listener at the bottom of your htlm page, extract the version and spew it out to a place holder.
    <div id="version"> </div>
    <script>
    window.addEventListener('load', (event) => { document.getElementById("version").innerHTML = "Version :" + JSON.stringify(tf.version.tfjs); });
    </script>

Comments

Popular posts from this blog

Decompiling Delphi - 3

Decompiling Delphi - 2

Artificial Intelligence, Oxymoron and Natural Intelligence