Backends/SiaNet.Backend.Torch/FileOperations.cs
/// <summary>
///   Write longs to the file from the given long array.
/// </summary>
/// <param name="data">An array containing data to be written to the file.</param>
/// <param name="n">The number of longs to write. Pass -1 (default) to write the whole array.</param>
/// <returns>The number of longs written.</returns>
Write longs to the file from the given long array.
Write longs to the file from the given long array .
public long WriteLongs(long[] data, int n = -1)
        {
            if (n < -1)
                throw new ArgumentOutOfRangeException("n cannot be less than -1");
            n = (n == -1) ? data.Length : Math.Min(n, data.Length);
            unsafe
            {
                fixed (long *dest = data)
                {
                    var writtenItems = THFile_writeLongRaw(this.handle, (IntPtr)dest, n);
                    return writtenItems;
                }
            }
        }
public long WriteLongs ( long [ ] data , int n = - 1 ) { if ( n < - 1 ) throw new ArgumentOutOfRangeException ( " " ) ; n = ( n == - 1 ) ? data . Length : Math . Min ( n , data . Length ) ; unsafe { fixed ( long * dest = data ) { var writtenItems = THFile_writeLongRaw ( this . handle , ( IntPtr ) dest , n ) ; return writtenItems ; } } }
Write longs to the file from the given long array.
Write longs to the file from the given long array .
The number of longs written.
The number of longs written .
data
long[]
An array containing data to be written to the file.
An array containing data to be written to the file .
n
int
The number of longs to write. Pass -1 (default) to write the whole array.
The number of longs to write . Pass - 1 ( default ) to write the whole array .