コード例 #1
0
ファイル: FileOperations.cs プロジェクト: shauheen/TorchSharp
 /// <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
ファイル: FileOperations.cs プロジェクト: shauheen/TorchSharp
 /// <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));
 }