#!/usr/bin/env bash

# Assumes EDDL compiled for GPU.

set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
this="${BASH_SOURCE-$0}"
this_dir=$(cd -P -- "$(dirname -- "${this}")" && pwd -P)

names=(
    to_from_string
    save_net_to_file
)

for n in "${names[@]}"; do
    echo -en "\n*** ${n} ***\n"
    python3 "${this_dir}"/${n}.py --gpu --epochs 1 --small
done

echo -en "\n*** import_net_from_file ***\n"
python3 "${this_dir}"/import_net_from_file.py --gpu

echo -en "\n*** check_getout_forward ***\n"
python3 "${this_dir}"/check_getout_forward.py --gpu
