Skip to content

Commit a5d4ed8

Browse files
committed
NDArray: Made Shape public.
1 parent e284971 commit a5d4ed8

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/NumSharp.Bitmap/np_.extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static unsafe Bitmap ToBitmap(this NDArray nd, int width, int height)
117117
if (width * height != nd.size)
118118
throw new ArgumentException("Given nd.size != width*height");
119119

120-
if (!nd.Unsafe.Shape.IsContiguous)
120+
if (!nd.Shape.IsContiguous)
121121
nd = nd.Clone();
122122

123123
var ret = new Bitmap(height, width);

src/NumSharp.Core/Backends/NDArray.Unmanaged.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ internal IArraySlice Array
7474
/// <summary>
7575
/// Provides access to the internal <see cref="Shape"/>.
7676
/// </summary>
77+
[Obsolete("Please use nd.Shape directly instead of nd.Unsafe.Shape, will be removed in 0.21.0")]
7778
public Shape Shape => _this.Storage.Shape;
7879

7980
/// A Span representing this slice.

src/NumSharp.Core/Backends/NDArray.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ public NDArray T
303303
}
304304
}
305305

306-
protected internal Shape Shape
306+
/// <summary>
307+
/// The shape representing this <see cref="NDArray"/>.
308+
/// </summary>
309+
public Shape Shape
307310
{
308311
[MethodImpl(MethodImplOptions.AggressiveInlining)]
309312
get => Storage.Shape;

0 commit comments

Comments
 (0)