示例#1
0
 /// <summary>
 ///   Write ints to the file from the given int tensor.
 /// </summary>
 /// <param name="tensor">A tensor containing data to be written to the file.</param>
 /// <returns>The number of ints written.</returns>
 public long WriteTensor(AtenSharp.IntTensor tensor)
 {
     return(THFile_writeIntRaw(this.handle, tensor.Data, tensor.NumElements));
 }
示例#2
0
 /// <summary>
 ///   Read ints from the file into the given int tensor.
 /// </summary>
 /// <param name="tensor">A tensor to place the data in after reading it from the file.</param>
 /// <returns>The number of ints read.</returns>
 public long ReadTensor(AtenSharp.IntTensor tensor)
 {
     return(THFile_readIntRaw(this.handle, tensor.Data, tensor.NumElements));
 }