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