Skip to content

Commit 956d19b

Browse files
authored
Added script for creating C++ templates (#1)
1 parent 573c276 commit 956d19b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

create_template.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
For creating C++ templates.
3+
Write the code string in
4+
`code` variable and specify
5+
data types in string arguments.
6+
"""
7+
data_types = [
8+
'bool',
9+
'short',
10+
'unsigned short',
11+
'int',
12+
'unsigned int',
13+
'long',
14+
'unsigned long',
15+
'long long',
16+
'unsigned long long',
17+
'float',
18+
'double',
19+
'long double'
20+
]
21+
22+
code = ("template class TensorCPU<%s>;")
23+
24+
for dt in data_types:
25+
print(code%(dt))

0 commit comments

Comments
 (0)