* Returns the libtensorflow hosted path of the current platform.
()
| 86 | * Returns the libtensorflow hosted path of the current platform. |
| 87 | */ |
| 88 | function 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…