MCPcopy Create free account
hub / github.com/tensorflow/tfjs / getPlatformLibtensorflowUri

Function getPlatformLibtensorflowUri

tfjs-node/scripts/install.js:88–114  ·  view source on GitHub ↗

* Returns the libtensorflow hosted path of the current platform.

()

Source from the content-addressed store, hash-verified

86 * Returns the libtensorflow hosted path of the current platform.
87 */
88function getPlatformLibtensorflowUri() {
89 // Exception for mac+gpu user
90 if (platform === 'darwin') {
91 if (os.arch() === 'arm64') {
92 return `${BASE_HOST}tf-builds/libtensorflow_r2_7_darwin_arm64_cpu.tar.gz`;
93 }
94 system = `cpu-${PLATFORM_MAPPING[platform]}-${ARCH_MAPPING[os.arch()]}`;
95 }
96
97 if (customTFLibUri !== undefined) {
98 return customTFLibUri;
99 }
100
101 if (platform === 'linux') {
102 if (os.arch() === 'arm') {
103 return `${BASE_HOST}tf-builds/libtensorflow_r2_5_linux_arm7l.tar.gz`;
104 } else if (os.arch() === 'arm64') {
105 return `${BASE_HOST}tf-builds/libtensorflow_r2_7_linux_arm64.tar.gz`;
106 }
107 }
108
109 if (ALL_SUPPORTED_COMBINATION.indexOf(system) === -1) {
110 throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
111 }
112
113 return `${BASE_URI}${system}-${LIBTENSORFLOW_VERSION}.${PLATFORM_EXTENSION}`;
114}
115
116/**
117 * Ensures a directory exists, creates as needed.

Callers 1

downloadLibtensorflowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…