Skip to content

Commit

Permalink
fixed error exspecting a ndarray, but a single number is forwarded
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JochiSt authored and jmduarte committed Jun 19, 2022
1 parent 0c34f97 commit 13476ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hls4ml/model/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ class TraceData(ctypes.Structure):
for i in range(n_samples):
predictions = np.zeros(self.get_output_variables()[0].size(), dtype=ctype)
if n_inputs == 1:
top_function(x[i], predictions, ctypes.byref(ctypes.c_ushort()), ctypes.byref(ctypes.c_ushort()))
top_function( np.array(x[i]), predictions, ctypes.byref(ctypes.c_ushort()), ctypes.byref(ctypes.c_ushort()))
else:
inp = [xj[i] for xj in x]
argtuple = inp
Expand Down

0 comments on commit 13476ec

Please sign in to comment.