Backends/SiaNet.Backend.TensorSharp/Cuda/ApplyUtils.cs
/// <summary>
/// Gets the innermost non1 dim.
/// </summary>
/// <param name="sizes">The sizes.</param>
/// <param name="excludeDim">The exclude dim.</param>
/// <returns>System.Int32.</returns>
Gets the innermost non1 dim.
Gets the innermost non1 dim .
private static int GetInnermostNon1Dim(long[] sizes, int excludeDim)
        {
            for (int i = sizes.Length - 1; i >= 0; --i)
            {
                if (i == excludeDim)
                {
                    return i;
                }
                if (sizes[i] != 1)
                {
                    return i;
                }
            }
            return -1;
        }
private static int GetInnermostNon1Dim ( long [ ] sizes , int excludeDim ) { for ( int i = sizes . Length - 1 ; i >= 0 ; -- i ) { if ( i == excludeDim ) { return i ; } if ( sizes [ i ] != 1 ) { return i ; } } return - 1 ; }
Gets the innermost non1 dim.
Gets the innermost non1 dim .
None
sizes
long[]
None
excludeDim
int
The exclude dim.
The exclude dim .