Releases, starting with 9/2/2021, are listed with the most recent release at the top.
API Changes:
#587 Added the Storage classes, and Tensor.storage()
Fixed Bugs:
#582 unbind missing
#592 GRU and Input and hidden tensors are not at the same device,[...]
Same-day release. The previous release was made without propert testing of the ToString() improvements in a notebook context. It turned out that when the standard Windows line-terminator "\r\n" is used in a VS Code notebook, an extra blank line is created.
This release fixes that by allowing the caller of ToString() to pass in the line terminator string that should be used when formatting the string. This is easily done in the notebook.
In this release, the big change is support for .NET FX 4.7.2 and later.
There are no breaking changes that we are aware of, but see the comment on API Changes below -- backporting code to .NET 4.7 or 4.8, which were not previously supported, may lead to errors in code that uses tensor indexing.
API Changes:
Due to the unavailability of System.Range
in .NET FX 4.7, indexing of tensors using the [a..b]
syntax is not available. In its place, we have added support for using tuples as index expressions, with the same semantics, except that the "from end" unary operator ^
of the C# range syntax is not available. The tuple syntax is also available for versions of .NET that do support System.Range
A second piece of new functionality was to integrate @dayo05's work on DataLoader into the Examples. A couple of MNIST and CIFAR data sets are now found in torchvision.datasets
A Numpy-style version of ToString() was added to the existing Julia-style, and the argument to the verbose ToString() was changed from 'Boolean' to an enumeration.
A number of the "bugs" listed below represent missing APIs.
Fixed Bugs:
#519 Multiprocessing dataloader support
#529 pin_memory missing
#545 Implement FractionalMaxPool{23}d
#554 Implement MaxUnpool{123}d
#555 Implement LPPool{12}d
#556 Implement missing activation modules
#559 Implement miscellaneous missing layers.
#564 torch.Tensor.tolist
#566 Implicit conversion of scalars to tensors
#576 load_state_dict functionality
API Changes:
NOTE: This release contains breaking changes.
The APIs to create optimizers all take 'parameters()' as well as 'named_parameters()' now.
Support for parameter groups in most optimizers.
Support for parameter groups in LR schedulers.
Fixed Bugs:
#495 Add support for OptimizerParamGroup
#509 Tensor.conj() not implemented
#515 what's reason for making register_module internal?
#516 AdamW bug on v0.96.0
#521 Can't set Tensor slice using indexing
#525 LSTM's forward function not work with null hidden and cell state
#532 Why does storing module layers in arrays break the learning process?
NOT RELEASED
API Changes:
Fixed Bugs:
Using libtorch CPU packages from F# Interactive required explicit native loads
#510 Module.Load throws Mismatched state_dict sizes exception on BatchNorm1d
API Changes:
NOTE: This release contains breaking changes.
'Module.named_parameters()', 'parameters()', 'named_modules()', 'named_children()' all return IEnumerable instances instead of arrays.
Adding weight and bias properties to the RNN modules.
Lower-cased names: Module.Train --> Module.train and Module.Eval --> Module.eval
Fixed Bugs:
#496 Wrong output shape of torch.nn.Conv2d with 2d stride overload
#499 Setting Linear.weight is not reflected in 'parameters()'
#500 BatchNorm1d throws exception during eval with batch size of 1
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.