Skip to content

Commit 8d3ecb8

Browse files
committed
add boolean for np.ones
1 parent 80213ee commit 8d3ecb8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/NumSharp.Core/Creation/NumPy.ones.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public NDArray ones(Shape shape, Type dtype = null)
4848
case "Double":
4949
nd.Set(Enumerable.Range(0, nd.size).Select(x => 1.0).ToArray());
5050
break;
51+
52+
case "Boolean":
53+
nd.Set(Enumerable.Range(0, nd.size).Select(x => true).ToArray());
54+
break;
5155
}
5256

5357
return nd;

0 commit comments

Comments
 (0)