@@ -85,13 +85,15 @@ def get_array_interface(self):
85
85
idx1 = cppname .find ("RTensor<" )
86
86
idx2 = cppname .find ("," , idx1 )
87
87
dtype = cppname [idx1 + 8 : idx2 ]
88
- # dtype_numpy = _array_interface_dtype_map[dtype]
89
88
for numpy_dtype , type_info in _numpy_dtype_typeinfo_map .items ():
90
89
if dtype == type_info ["cpp" ] or dtype == type_info ["typedef" ]:
91
90
dtype_numpy = numpy_dtype
92
91
dtype_size = cppyy .sizeof (dtype )
93
92
break
94
- dtype_size = cppyy .sizeof (dtype )
93
+
94
+ if dtype_numpy :
95
+ raise RuntimeError (f"Unsupported dtype '{ dtype } ' found in RTensor." )
96
+
95
97
endianness = "<" if sys .byteorder == "little" else ">"
96
98
shape = self .GetShape ()
97
99
strides = self .GetStrides ()
@@ -103,7 +105,7 @@ def get_array_interface(self):
103
105
return {
104
106
"shape" : tuple (s for s in shape ),
105
107
"strides" : tuple (s * dtype_size for s in strides ),
106
- "typestr" : "{}{}{} " .format (endianness , dtype_numpy , dtype_size ),
108
+ "typestr" : "{}{}" .format (endianness , dtype_numpy ),
107
109
"version" : 3 ,
108
110
"data" : (pointer , False ),
109
111
}
0 commit comments