Skip to content

Commit

Permalink
scalar -> atleast_2d (#138)
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman authored Sep 7, 2023
1 parent d49368e commit 5ab435f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stream_ml/pytorch/prior/_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

def _atleast_2d(x: Array) -> Array:
"""Ensure that x is at least 2d."""
if x.ndim == 1:
if x.ndim == 0:
return x[None, None]
elif x.ndim == 1:
return x[:, None]
return x

Expand Down

0 comments on commit 5ab435f

Please sign in to comment.