generate_protostr.sh 912 字节
Newer Older
1 2 3 4 5 6
#!/bin/bash

set -e
cd `dirname $0`
export PYTHONPATH=$PWD/../../../../

7
protostr=$PWD/protostr
8
. file_list.sh
9 10 11 12

for conf in ${configs[*]}
do
    echo "Generating " $conf
L
liaogang 已提交
13
    $1 -m paddle.utils.dump_config $conf.py > $protostr/$conf.protostr.unittest
14 15 16
    if [ ! -f "$protostr/$conf.protostr" ]; then 
        cp $protostr/$conf.protostr.unittest $protostr/$conf.protostr
    fi
L
liaogang 已提交
17
    cat ${conf}.py |$1 test_config_parser_for_non_file_config.py > $protostr/$conf.protostr.non_file_config.unittest
18
done
Y
Yu Yang 已提交
19 20 21 22

for conf in ${whole_configs[*]}
do
    echo "Generating " $conf
L
liaogang 已提交
23
    $1 -m paddle.utils.dump_config $conf.py "" --whole > $protostr/$conf.protostr.unittest
24 25 26
    if [ ! -f "$protostr/$conf.protostr" ]; then 
        cp $protostr/$conf.protostr.unittest $protostr/$conf.protostr
    fi
L
liaogang 已提交
27
    cat ${conf}.py |$1 test_config_parser_for_non_file_config.py --whole > $protostr/$conf.protostr.non_file_config.unittest
Y
Yu Yang 已提交
28
done