File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ public static partial class np
10
10
{
11
11
public static BackendType BackendEngine { get ; set ; }
12
12
13
+ /// <summary>
14
+ /// A convenient alias for None, useful for indexing arrays.
15
+ /// </summary>
16
+ /// <remarks>https://docs.scipy.org/doc/numpy-1.17.0/reference/arrays.indexing.html<br></br><br></br>https://stackoverflow.com/questions/42190783/what-does-three-dots-in-python-mean-when-indexing-what-looks-like-a-number</remarks>
17
+ public static readonly Slice newaxis = new Slice ( null , null , 1 ) { IsNewAxis = true } ;
18
+
13
19
// https://docs.scipy.org/doc/numpy-1.16.0/user/basics.types.html
14
20
public static readonly Type bool_ = typeof ( bool ) ;
15
21
public static readonly Type bool8 = bool_ ;
Original file line number Diff line number Diff line change @@ -20,9 +20,12 @@ public UnmanagedStorage GetView(params Slice[] slices)
20
20
throw new ArgumentNullException ( nameof ( slices ) ) ;
21
21
22
22
foreach ( var slice in slices )
23
+ {
23
24
if ( slice . IsEllipsis )
24
25
throw new NotSupportedException ( "Ellipsis slicing '...' is not supported by NumSharp." ) ;
25
-
26
+ if ( slice . IsNewAxis )
27
+ throw new NotSupportedException ( "np.newaxis slicing '...' is not supported by NumSharp. Consider calling np.expand_dims after performing slicing" ) ;
28
+ }
26
29
//handle memory slice if possible
27
30
if ( ! _shape . IsSliced )
28
31
{
You can’t perform that action at this time.
0 commit comments