Skip to content
Prev Previous commit
Next Next commit
save
  • Loading branch information
Nikhil Thorat committed Oct 1, 2019
commit cb7e9d4e1a5c02abbc7033ddc67bed9688830b1f
8 changes: 0 additions & 8 deletions tfjs-converter/src/data/compiled_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
* =============================================================================
*/

// This incantation makes Closure think that exported symbols are mutable.
// Mutable file-level exports are disallowed per style and won't reliably
// work. This hack also has a cost in terms of code size, and is only used
// to preserve the preexisting behavior of this code.
// tslint:disable-next-line:ban-ts-ignore see above
// @ts-ignore
exports = {};

/* tslint:disable */

/** Properties of an Any. */
Expand Down
2 changes: 1 addition & 1 deletion tfjs-core/benchmarks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h2>TensorFlow.js Model Benchmark</h2>

async function showEnvironment() {
await tf.time(() => tf.add(tf.tensor1d([1]), tf.tensor1d([1])).data());
envDiv.innerHTML += `<br/>${JSON.stringify(tf.environment().features, null, 2)
envDiv.innerHTML += `<br/>${JSON.stringify(tf.env().features, null, 2)
} `;
}

Expand Down
8 changes: 4 additions & 4 deletions tfjs-core/src/backends/cpu/backend_cpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import * as seedrandom from 'seedrandom';

import {ENGINE} from '../../engine';
import {environment} from '../../environment';
import {env} from '../../environment';

import {warn} from '../../log';
import * as array_ops_util from '../../ops/array_ops_util';
Expand Down Expand Up @@ -93,7 +93,7 @@ export class MathBackendCPU implements KernelBackend {
private firstUse = true;

constructor() {
if (environment().get('IS_BROWSER')) {
if (env().get('IS_BROWSER')) {
const canvas = createCanvas();
if (canvas !== null) {
this.fromPixels2DContext =
Expand All @@ -106,7 +106,7 @@ export class MathBackendCPU implements KernelBackend {
register(dataId: DataId, shape: number[], dtype: DataType): void {
if (this.firstUse) {
this.firstUse = false;
if (environment().get('IS_NODE')) {
if (env().get('IS_NODE')) {
warn(
'\n============================\n' +
'Hi there 👋. Looks like you are running TensorFlow.js in ' +
Expand Down Expand Up @@ -155,7 +155,7 @@ export class MathBackendCPU implements KernelBackend {
[pixels.width, pixels.height];
let vals: Uint8ClampedArray|Uint8Array;
// tslint:disable-next-line:no-any
if (environment().get('IS_NODE') && (pixels as any).getContext == null) {
if (env().get('IS_NODE') && (pixels as any).getContext == null) {
throw new Error(
'When running in node, pixels must be an HTMLCanvasElement ' +
'like the one returned by the `canvas` npm package');
Expand Down
Loading