MCPcopy Index your code
hub / github.com/tensorflow/tfjs / setPlatform

Method setPlatform

tfjs-core/src/environment.ts:58–68  ·  view source on GitHub ↗
(platformName: string, platform: Platform)

Source from the content-addressed store, hash-verified

56 }
57
58 setPlatform(platformName: string, platform: Platform) {
59 if (this.platform != null) {
60 if (!(env().getBool('IS_TEST') || env().getBool('PROD'))) {
61 console.warn(
62 `Platform ${this.platformName} has already been set. ` +
63 `Overwriting the platform with ${platformName}.`);
64 }
65 }
66 this.platformName = platformName;
67 this.platform = platform;
68 }
69
70 registerFlag(
71 flagName: string, evaluationFn: FlagEvaluationFn,

Callers 5

setPlatformFunction · 0.80
platform_node.tsFile · 0.80

Calls 2

envFunction · 0.85
getBoolMethod · 0.80

Tested by

no test coverage detected