28 """make a command for running tf2tfliteV2.py"""
29 cmd = [sys.executable, os.path.expanduser(driver_path)]
32 cmd.append(
'--verbose')
35 cmd.append(getattr(args,
'model_format_cmd'))
37 cmd.append(
'--' + getattr(args,
'model_format'))
39 cmd.append(
'--graph_def')
42 cmd.append(getattr(args,
'converter_version_cmd'))
44 cmd.append(
'--' + getattr(args,
'converter_version'))
49 cmd.append(
'--input_path')
50 cmd.append(os.path.expanduser(input_path))
53 cmd.append(
'--output_path')
54 cmd.append(os.path.expanduser(output_path))
57 cmd.append(
'--input_arrays')
58 cmd.append(getattr(args,
'input_arrays'))
61 cmd.append(
'--input_shapes')
62 cmd.append(getattr(args,
'input_shapes'))
65 cmd.append(
'--output_arrays')
66 cmd.append(getattr(args,
'output_arrays'))
69 if is_valid_attr(args,
'experimental_disable_batchmatmul_unfold'):
70 cmd.append(
'--experimental_disable_batchmatmul_unfold')
82 """make a command for running circle2circle"""
83 cmd = [os.path.expanduser(c)
for c
in [driver_path, input_path, output_path]]
86 cmd.append(
'--generate_profile_data')
89 for opt
in _constant.CONSTANT.OPTIMIZATION_OPTS:
92 if type(getattr(args, opt[0]))
is bool:
93 cmd.append(
'--' + opt[0])
95 This condition check is for config file interface, usually would be
97 but user can write as follows while development
99 instead of removing SomeOption option
101 if type(getattr(args, opt[0]))
is str
and not getattr(
102 args, opt[0]).lower()
in [
'false',
'0',
'n']:
103 cmd.append(
'--' + opt[0])