Skip to content

Commit f73121f

Browse files
committed
fixed error exspecting a ndarray, but a single number is forwarded
When the input data is a single number, the test data is a one-dimensional array. From this array one number was forwareded to top_function. Changing this into an array solved this issue.
1 parent 068fff5 commit f73121f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hls4ml/model/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ class TraceData(ctypes.Structure):
713713
for i in range(n_samples):
714714
predictions = np.zeros(self.get_output_variables()[0].size(), dtype=ctype)
715715
if n_inputs == 1:
716-
top_function(x[i], predictions, ctypes.byref(ctypes.c_ushort()), ctypes.byref(ctypes.c_ushort()))
716+
top_function( np.array(x[i]), predictions, ctypes.byref(ctypes.c_ushort()), ctypes.byref(ctypes.c_ushort()))
717717
else:
718718
inp = [xj[i] for xj in x]
719719
argtuple = inp

0 commit comments

Comments
 (0)