util.py 486 字节
Newer Older
Y
Yibing Liu 已提交
1
import six
Y
Yibing Liu 已提交
2
import os
Y
Yibing Liu 已提交
3 4


Y
Yibing Liu 已提交
5 6
def print_arguments(args):
    print('-----------  Configuration Arguments -----------')
Y
Yibing Liu 已提交
7
    for arg, value in sorted(six.iteritems(vars(args))):
Y
Yibing Liu 已提交
8 9 10 11
        print('%s: %s' % (arg, value))
    print('------------------------------------------------')


Y
Yibing Liu 已提交
12 13 14 15 16 17 18 19
def mkdir(path):
    if not os.path.isdir(path):
        mkdir(os.path.split(path)[0])
    else:
        return
    os.mkdir(path)


Y
Yibing Liu 已提交
20 21 22 23 24 25
def pos_encoding_init():
    pass


def scaled_dot_product_attention():
    pass