Skip to content

Commit

Permalink
fix vector inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rykath committed May 10, 2023
1 parent 884f430 commit ab6e84f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion profit/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def params2map(params: Union[None, MutableMapping, np.ndarray, np.void]):
if isinstance(params, MutableMapping):
return params
try:
return {key: params[key] for key in params.dtype.names}
return {
key: params[key].item() if params[key].size == 1 else params[key]
for key in params.dtype.names
}
except AttributeError:
pass
raise TypeError("params are not a Mapping")
Expand Down

0 comments on commit ab6e84f

Please sign in to comment.