/// <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)); }
/// <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)); }