How to use the @tensorflow/tfjs-data.version_data function in @tensorflow/tfjs-data

To help you get started, we’ve selected a few @tensorflow/tfjs-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tensorflow / tfjs / tfjs / integration_tests / models / benchmarks.ts View on Github external
log = common.getLogFlagFromKarmaFlags();
    }
    console.log(`Boolean flag log = ${log}`);

    const taskType = 'model';
    let environmentInfo: EnvironmentInfo;
    if (isNodeJS) {
      environmentInfo = common.getNodeEnvironmentInfo(tfn);
    } else {
      environmentInfo = common.getBrowserEnvironmentInfo();
    }
    const versionSet: VersionSet = isNodeJS ? {versions: tfn.version} : {
      versions: {
        'tfjs-converter': tfconverter.version_converter,
        'tfjs-core': tfc.version_core,
        'tfjs-data': tfd.version_data,
        'tfjs-layers': tfl.version_layers
      }
    };

    let suiteLog: common.SuiteLog;
    if (isNodeJS) {
      // tslint:disable-next-line:no-require-imports
      const fs = require('fs');
      suiteLog = JSON.parse(fs.readFileSync(BENCHMARKS_JSON_PATH, 'utf-8'));
    } else {
      suiteLog =
          await (await fetch(BENCHMARKS_JSON_URL)).json() as common.SuiteLog;
    }
    const pyEnvironmentInfo = suiteLog.environmentInfo;
    const pyEnvironmentId =
        log ? await addEnvironmentInfoToFirestore(pyEnvironmentInfo) : null;

@tensorflow/tfjs-data

TensorFlow Data API in JavaScript

Apache-2.0
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis