summary refs log blame commit diff
path: root/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh
blob: d571d38f7719c857cf1d3aff02e289f494b1d2f0 (plain) (tree)
1
2
3
4
5
6

                   



                                         



















                                                                                                                            
#!/usr/bin/env bash

# ./prefetcher.sh 2.4.0 binary-hashes.nix

version="$1"
hashfile="$2"
rm -f $hashfile
echo "{" >> $hashfile
echo "version = \"$version\";" >> $hashfile
for sys in "linux" "darwin"; do
    for tfpref in "cpu" "gpu"; do
        for platform in "x86_64"; do
            if [ $sys = "darwin" ] && [ $tfpref = "gpu" ]; then
               continue
            fi
            url=https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-$tfpref-$sys-$platform-$version.tar.gz
            hash=$(nix-prefetch-url $url)
            echo "\"${tfpref}-${sys}-${platform}\" = {" >> $hashfile
            echo "  url = \"$url\";" >> $hashfile
            echo "  sha256 = \"$hash\";" >> $hashfile
            echo "};" >> $hashfile
        done
    done
done
echo "}" >> $hashfile