diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 605122563..5abbe1333 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -448,7 +448,7 @@ jobs:
- script: dotnet restore pkg/pack.proj /p:Configuration=Release
displayName: Restore package projects
- - script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=false /p:IncludeLibTorchCpuPackages=false /p:IncludeLibTorchCudaPackages=true pkg/pack.proj
+ - script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:ApiCompatGenerateSuppressionFile=true /p:IncludeTorchSharpPackage=false /p:IncludeLibTorchCpuPackages=false /p:IncludeLibTorchCudaPackages=true pkg/pack.proj
displayName: Create Packages
# We are 10GB space-constrained on the Azure Pipelines CI system so clean up what we can
diff --git a/src/TorchSharp/NN/Activation/Sigmoid.cs b/src/TorchSharp/NN/Activation/Sigmoid.cs
index e79283dfc..a88166932 100644
--- a/src/TorchSharp/NN/Activation/Sigmoid.cs
+++ b/src/TorchSharp/NN/Activation/Sigmoid.cs
@@ -45,7 +45,7 @@ public static Sigmoid Sigmoid()
///
/// Do the operation in-place. Default: False
///
- public static Sigmoid Sigmoid(bool inplace = false)
+ public static Sigmoid Sigmoid(bool inplace)
{
return new Sigmoid(inplace);
}
diff --git a/src/TorchSharp/NN/Activation/Softsign.cs b/src/TorchSharp/NN/Activation/Softsign.cs
index 216773216..83a368511 100644
--- a/src/TorchSharp/NN/Activation/Softsign.cs
+++ b/src/TorchSharp/NN/Activation/Softsign.cs
@@ -32,11 +32,19 @@ public static partial class torch
{
public static partial class nn
{
+ ///
+ /// Softsign
+ ///
+ public static Softsign Softsign()
+ {
+ return new Softsign(false);
+ }
+
///
/// Softsign
///
/// Do the operation in-place. Default: False
- public static Softsign Softsign(bool inplace = false)
+ public static Softsign Softsign(bool inplace)
{
return new Softsign(inplace);
}
diff --git a/src/TorchSharp/NN/Activation/Tanhshrink.cs b/src/TorchSharp/NN/Activation/Tanhshrink.cs
index f3d51312f..b22aa68fb 100644
--- a/src/TorchSharp/NN/Activation/Tanhshrink.cs
+++ b/src/TorchSharp/NN/Activation/Tanhshrink.cs
@@ -67,7 +67,7 @@ public static Tensor tanhshrink(Tensor x, bool inplace = false)
///
/// The input tensor
[Obsolete("Not using the PyTorch naming convention.",false)]
- public static Tensor tanhshrink(Tensor x) => tanhshrink(x, false);
+ public static Tensor Tanhshrink(Tensor x) => tanhshrink(x, false);
}
}
}
diff --git a/src/TorchSharp/NN/Activation/Threshold.cs b/src/TorchSharp/NN/Activation/Threshold.cs
index 8025a15e2..6ebd606be 100644
--- a/src/TorchSharp/NN/Activation/Threshold.cs
+++ b/src/TorchSharp/NN/Activation/Threshold.cs
@@ -70,8 +70,9 @@ public static Tensor threshold(Tensor x, double threshold, double value, bool in
/// The input tensor
/// The value to threshold at
/// The value to replace with
+ /// Do the operation in-place
[Obsolete("Not using the PyTorch naming convention.",false)]
- public static Tensor Threshold(Tensor x, double threshold, double value) => nn.functional.threshold(x, threshold, value, false);
+ public static Tensor Threshold(Tensor x, double threshold, double value, bool inplace = false) => nn.functional.threshold(x, threshold, value, inplace);
}
}
}
diff --git a/src/TorchSharp/NN/Module.cs b/src/TorchSharp/NN/Module.cs
index a903ad15f..498bda549 100644
--- a/src/TorchSharp/NN/Module.cs
+++ b/src/TorchSharp/NN/Module.cs
@@ -818,6 +818,11 @@ public virtual void register_module(string name, Module submodule)
}
}
+ protected void ConditionallyRegisterParameter(string name, Tensor value)
+ {
+ ConditionallyRegisterParameter(name, value as Parameter);
+ }
+
protected void ConditionallyRegisterParameter(string name, Parameter? value)
{
if (value is null) {
diff --git a/src/TorchSharp/Tensor/Tensor.cs b/src/TorchSharp/Tensor/Tensor.cs
index 90d07f953..3dc1016e2 100644
--- a/src/TorchSharp/Tensor/Tensor.cs
+++ b/src/TorchSharp/Tensor/Tensor.cs
@@ -2812,11 +2812,11 @@ public Tensor celu_(Scalar alpha)
return this;
}
- public Tensor elu(double alpha = 1) => elu1(alpha, 1.0, 1.0);
+ public Tensor elu(double alpha = 1) => elu(alpha, 1.0, 1.0);
- public Tensor elu_(double alpha = 1) => elu2(alpha, 1.0, 1.0);
+ public Tensor elu_(double alpha = 1) => elu(alpha, 1.0, 1.0);
- private Tensor elu1(Scalar alpha, Scalar scale, Scalar input_scale)
+ public Tensor elu(Scalar alpha, Scalar scale, Scalar input_scale)
{
var res = NativeMethods.THSTensor_elu(Handle, alpha.Handle, scale.Handle, input_scale.Handle);
if (res == IntPtr.Zero)
@@ -2824,7 +2824,7 @@ private Tensor elu1(Scalar alpha, Scalar scale, Scalar input_scale)
return new Tensor(res);
}
- private Tensor elu2(Scalar alpha, Scalar scale, Scalar input_scale)
+ public Tensor elu_(Scalar alpha, Scalar scale, Scalar input_scale)
{
NativeMethods.THSTensor_elu_(Handle, alpha.Handle, scale.Handle, input_scale.Handle);
CheckForErrors();