feature_extractor.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:confusion 作者: abhimanyudubey 项目源码 文件源码
def get_prototxt_string(inp_dict,ntabs=0,inp_key=None):
    output_string = ''
    if type(inp_dict) is list:
        for elem in inp_dict:
            output_string += ' '*ntabs + str(inp_key) + get_prototxt_string(elem,ntabs)+'\n'
    elif type(inp_dict) is OrderedDict:
        output_string += ' {\n'
        for key,value in inp_dict.iteritems():
            if type(value) is list:
                output_string += ' '*ntabs + get_prototxt_string(value,ntabs+1,key) + '\n'
            else:
                output_string += ' '*ntabs + str(key) +' ' + get_prototxt_string(value,ntabs+1,key) + '\n'
        output_string += ' '*ntabs + '}\n'
    else:
        output_string += ' : '+get_prototxt_format(inp_key,inp_dict)
    return output_string
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号