예제 #1
0
 /// <summary>
 ///   Write floats to the file from the given float tensor.
 /// </summary>
 /// <param name="tensor">A tensor containing data to be written to the file.</param>
 /// <returns>The number of floats written.</returns>
 public long WriteTensor(AtenSharp.FloatTensor tensor)
 {
     return(THFile_writeFloatRaw(this.handle, tensor.Data, tensor.NumElements));
 }
예제 #2
0
 /// <summary>
 ///   Read floats from the file into the given float tensor.
 /// </summary>
 /// <param name="tensor">A tensor to place the data in after reading it from the file.</param>
 /// <returns>The number of floats read.</returns>
 public long ReadTensor(AtenSharp.FloatTensor tensor)
 {
     return(THFile_readFloatRaw(this.handle, tensor.Data, tensor.NumElements));
 }