From 916d81884333739d8d55b2cfa7a9896f35da83b1 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Thu, 19 Mar 2020 12:12:26 +0530 Subject: [PATCH] Add files via upload --- create_template.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 create_template.py diff --git a/create_template.py b/create_template.py new file mode 100644 index 0000000..05d7c12 --- /dev/null +++ b/create_template.py @@ -0,0 +1,25 @@ +""" +For creating C++ templates. +Write the code string in +`code` variable and specify +data types in string arguments. +""" +data_types = [ + 'bool', + 'short', + 'unsigned short', + 'int', + 'unsigned int', + 'long', + 'unsigned long', + 'long long', + 'unsigned long long', + 'float', + 'double', + 'long double' +] + +code = ("template class TensorCPU<%s>;") + +for dt in data_types: + print(code%(dt))