1 from optparse
import OptionParser
3 parser = OptionParser()
4 parser.add_option(
'-o',
'--output', help=
'where to write the result file.',
5 action=
'store', default=
'.')
6 options, _ = parser.parse_args()
10 '../../csrc/generic/TensorMethods.cwrap',
12 '../../csrc/generic/methods/Tensor.cwrap',
13 '../../csrc/generic/methods/TensorApply.cwrap',
14 '../../csrc/generic/methods/TensorCompare.cwrap',
15 '../../csrc/generic/methods/TensorCuda.cwrap',
16 '../../csrc/generic/methods/TensorMath.cwrap',
17 '../../csrc/generic/methods/TensorRandom.cwrap',
21 declaration_lines = []
23 for filename
in files:
24 with open(filename,
'r') as file: 25 in_declaration = False 26 for line
in file.readlines():
30 declaration_lines.append(line)
32 in_declaration =
False 33 declaration_lines.append(line)
35 declaration_lines.append(line)
37 with open(options.output,
'w')
as output:
38 output.write(
'\n'.join(declaration_lines) +
'\n')