Backends/SiaNet.Backend.TensorSharp/NDArray.cs
/// <summary>
/// Determines whether this instance is contiguous.
/// </summary>
/// <returns><c>true</c> if this instance is contiguous; otherwise, <c>false</c>.</returns>
Determines whether this instance is contiguous.
Determines whether this instance is contiguous .
public bool IsContiguous()
        {
            long z = 1;
            for (int d = shape.Length - 1; d >= 0; d--)
            {
                if (shape[d] != 1)
                {
                    if (strides[d] == z)
                        z *= shape[d];
                    else
                        return false;
                }
            }
            return true;
        }
public bool IsContiguous ( ) { long z = 1 ; for ( int d = shape . Length - 1 ; d >= 0 ; d -- ) { if ( shape [ d ] != 1 ) { if ( strides [ d ] == z ) z *= shape [ d ] ; else return false ; } } return true ; }
Determines whether this instance is contiguous.
Determines whether this instance is contiguous .
None