Releases, starting with 9/2/2021, are listed with the most recent release at the top.
API Changes:
Added OneCycleLR and CyclicLR schedulers
Added DisposeScopeManager and torch.NewDisposeScope() to facilitate a new solution for managing disposing of tensors with fewer usings.
Added Tensor.set_()
Added 'copy' argument to Tensor.to()
NOTES:
The 'Weight' and 'Bias' properties on some modules have been renamed 'weight' and 'bias'.
The 'LRScheduler.LearningRate' property has been removed. To log the learning rate, get it from the optimizer that is in use.
Fixed Bugs:
#476 BatchNorm does not expose bias,weight,running_mean,running_var
#475 Loading Module that's on CUDA
#372 Module.save moves Module to CPU
#468 How to set Conv2d kernel_size=(2,300)
#450 Smoother disposing
API Changes:
The previously unused Tensor.free() method was renamed 'DecoupleFromNativeHandle()' and is meant to be used in native interop scenarios.
Tensor.Handle will now validate that the internal handle is not 'Zero', and throw an exception when it is. This will catch situations where a disposed tensor is accessed.
Fixed Bugs:
There were a number of functions in torchvision, as well as a number of optimizers, that did not properly dispose of temporary and intermediate tensor values, leading to "memory leaks" in the absence of explicit GC.Collect() calls.
A couple of randint() overloads caused infinite recursion, crashing the process.
API Changes:
Added a Sequential factory method to create Sequential from a list of anonymous submodules.
Added TotalCount and PeakCount static properties to Tensor, useful for diagnostic purposes.
Fixed Bugs:
#432 Sequential does not dispose of intermediary tensors.
This version integrates with LibTorch 1.10.0.
API Changes:
Added a 'strict' option to Module.load().
See tracking issue #416 for a list of new 1.10.0 APIs. dotnet#416
Fixed Bugs:
#414 LRScheduler -- not calling the optimizer to step() [The original, closing fix was actually incorrect, but was then fixed again.]
API Changes:
Added the NAdam and RAdam optimizers.
Added several missing and new learning rate schedulers.
Fixed Bugs:
#413 Random Distributions Should Take a Generator Argument
#414 LRScheduler -- not calling the optimizer to step()
API Changes:
Added Module.Create() to create a model and load weights.
Fixed Bugs:
#407 rand() and randn() must check that the data type is floating-point.
#410 Support for passing random number generators to rand(), randn(), and randint()
API Changes:
Added some overloads to make F# usage more convenient.
Added convenience overloads to a number of random distribution factories.
Added '_' to the torch.nn.init functions. They overwrite the input tensor, so they should have the in-place indicator.
Fixed Bugs:
#399 Data() returns span that must be indexed using strides.
This was a major bug, affecting any code that pulled data out of a tensor view.
API Changes:
Tensor.Data() -> Tensor.data()
Tensor.DataItem() -> Tensor.item()
Tensor.Bytes() -> Tensor.bytes
Tensor.SetBytes() -> Tensor.bytes
This release introduces a couple of new NuGet packages, which bundle the native libraries that you need:
TorchSharp-cpu
TorchSharp-cuda-linux
TorchSharp-cuda-windows
With this release, the native libtorch package version was updated to 1.9.0.11, and that required rebuilding this package.
With this release, releases will have explicit control over the patch version number.
Fixed Bugs:
Fixed incorrectly implemented Module APIs related to parameter / module registration.
Changed Module.state_dict() and Module.load() to 'virtual,' so that saving and restoring state may be customized.
#353 Missing torch.minimum (with an alternative raising exception)
#327 Tensor.Data should do a type check
#358 Implement ModuleList / ModuleDict / Parameter / ParameterList / ParameterDict
API Changes:
Removed the type-named tensor factories, such as 'Int32Tensor.rand(),' etc.
Documentation Changes:
Added an article on creating custom modules.
This was the first release since moving TorchSharp to the .NET Foundation organization. Most of the new functionality is related to continuing the API changes that were started in the previous release, and fixing some bugs.
Fixed Bugs:
#318 A few inconsistencies with the new naming
Added Features:
torch.nn.MultiHeadAttention
torch.linalg.cond
torch.linalg.cholesky_ex
torch.linalg.inv_ex
torch.amax/amin
torch.matrix_exp
torch.distributions.* (about half the namespace)
API Changes:
CustomModule removed, its APIs moved to Module.