Edit

Share via


MLMultiArray.Strides Property

Definition

The number of elements to skip to advance an index value by one in the chosen direction.

[ObjCRuntime.TV(11, 0)]
[ObjCRuntime.Watch(4, 0)]
public nint[] Strides { get; }
member this.Strides : nint[]

Property Value

System.System.IntPtr[]

System.nativeint[]

Attributes

Remarks

MLMultiArray objects can be treated as one-dimensional arrays. The Strides property retrieves the number of elements in a one-dimensional array that are necessary to "skip over" in order to advance by 1 in the desired dimension.

NSError err;
var ma = new CoreML.MLMultiArray(new NSNumber[] { 3, 5, 7, 9 },CoreML.MLMultiArrayDataType.Int32, out err);
if (err != null) 
{
   HandleError(err);
   return;
}
var strides = ma.Strides;
/*
strides[0] = 315
strides[1] =  63
strides[2] =   9
strides[3] =   1
*/        

Applies to