importsysfrompaddle.fluid.frameworkimportProgramops_h="https://raw.githubusercontent.com/PaddlePaddle/Paddle-Lite/develop/lite/api/_paddle_use_ops.h"try:fetch=urllib.urlretrieve(ops_h,"./_paddle_use_ops.h")except:fetch=urllib.request.urlretrieve(ops_h,"./_paddle_use_ops.h")ops=list()withopen("./_paddle_use_ops.h")asf:forlineinf:if"USE_LITE_OP"inline:op=line.strip().split('(')[1].split(')')[0]ops.append(op)model_file=sys.argv[1]withopen(model_file,'rb')asf:program=Program.parse_from_string(f.read())unsupported_ops=set()foropinprogram.blocks[0].ops:ifop.typenotinops:unsupported_ops.add(op.type)nums=len(unsupported_ops)iflen(unsupported_ops)>0:print("========= {} OPs are not supported in Paddle-Lite=========".format(nums))foropinunsupported_ops:print("========= {} ========".format(op))else:print("\n========== Good News! ========")print("Good! All ops in this model are supported in Paddle-Lite!\n")