ci: update release ci.pull/1047/head
| @@ -8,6 +8,7 @@ on: | |||||
| branches: [ "master" ] | branches: [ "master" ] | ||||
| pull_request: | pull_request: | ||||
| branches: [ "master" ] | branches: [ "master" ] | ||||
| types: ["opened", "reopened", "synchronize", "ready_for_review", "auto_merge_enabled"] | |||||
| jobs: | jobs: | ||||
| windows: | windows: | ||||
| @@ -24,8 +25,8 @@ jobs: | |||||
| run: dotnet restore | run: dotnet restore | ||||
| - name: Build CPU version | - name: Build CPU version | ||||
| run: dotnet build --no-restore | run: dotnet build --no-restore | ||||
| # - name: Test CPU version | |||||
| # run: dotnet test --no-build --verbosity normal | |||||
| - name: Test CPU version | |||||
| run: dotnet test --no-build --verbosity normal | |||||
| - name: uninstall redist cpu for unit tests | - name: uninstall redist cpu for unit tests | ||||
| run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist | run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist | ||||
| - name: install redist gpu for unit tests | - name: install redist gpu for unit tests | ||||
| @@ -51,8 +52,8 @@ jobs: | |||||
| run: dotnet restore | run: dotnet restore | ||||
| - name: Build CPU version | - name: Build CPU version | ||||
| run: dotnet build --no-restore | run: dotnet build --no-restore | ||||
| # - name: Test CPU version | |||||
| # run: dotnet test --no-build --verbosity normal | |||||
| # - name: Test CPU version | |||||
| # run: dotnet test --no-build --verbosity normal | |||||
| - name: uninstall redist cpu for unit tests | - name: uninstall redist cpu for unit tests | ||||
| run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist | run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist | ||||
| - name: install redist gpu for unit tests | - name: install redist gpu for unit tests | ||||
| @@ -1,6 +1,6 @@ | |||||
| name: release | |||||
| name: auto-release | |||||
| on: | |||||
| on: | |||||
| workflow_run: | workflow_run: | ||||
| workflows: ["build_and_test"] | workflows: ["build_and_test"] | ||||
| types: | types: | ||||
| @@ -12,6 +12,7 @@ env: | |||||
| jobs: | jobs: | ||||
| build: | build: | ||||
| if: ${{ github.event.label.name == 'auto-release'}} | |||||
| runs-on: windows-latest | runs-on: windows-latest | ||||
| steps: | steps: | ||||
| @@ -67,7 +68,8 @@ jobs: | |||||
| - name: Pack packages | - name: Pack packages | ||||
| run: | | run: | | ||||
| $LastTag = git describe --tags (git rev-list --tags --max-count=1); | |||||
| git fetch; | |||||
| $LastTag = git describe --tags; | |||||
| echo "Last tag is: $LastTag"; | echo "Last tag is: $LastTag"; | ||||
| $Version = ($LastTag).TrimStart('v'); | $Version = ($LastTag).TrimStart('v'); | ||||
| echo "Publishing version: $Version"; | echo "Publishing version: $Version"; | ||||
| @@ -88,5 +90,11 @@ jobs: | |||||
| - name: Add myget nuget source | - name: Add myget nuget source | ||||
| run: dotnet nuget add source https://www.myget.org/F/rinne/api/v2/package --name myget.org | run: dotnet nuget add source https://www.myget.org/F/rinne/api/v2/package --name myget.org | ||||
| - name: Push packages to myget.org | |||||
| run: dotnet nuget push .\packages\TensorFlow*.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate | |||||
| - name: Push TensorFlow.NET to myget.org | |||||
| run: dotnet nuget push .\packages\TensorFlow.NET.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate | |||||
| - name: Push TensorFlow.Keras to myget.org | |||||
| run: dotnet nuget push .\packages\TensorFlow.Keras.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate | |||||
| - name: Push TensorFlow.Hub to myget.org | |||||
| run: dotnet nuget push .\packages\TensorFlow.Hub.nupkg -s myget.org -k $env:MYGET_API_TOKEN --skip-duplicate | |||||
| @@ -5,7 +5,7 @@ | |||||
| <LangVersion>10</LangVersion> | <LangVersion>10</LangVersion> | ||||
| <Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
| <Version>1.0.0</Version> | <Version>1.0.0</Version> | ||||
| <PackageId>TensorFlow.NET.Hub</PackageId> | |||||
| <PackageId>TensorFlow.Hub</PackageId> | |||||
| <PackageLicenseExpression>Apache2.0</PackageLicenseExpression> | <PackageLicenseExpression>Apache2.0</PackageLicenseExpression> | ||||
| <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||||
| <SignAssembly>true</SignAssembly> | <SignAssembly>true</SignAssembly> | ||||
| @@ -49,7 +49,7 @@ namespace Tensorflow.Keras.UnitTest.Layers | |||||
| Tensor input = tf.constant(new float[] { -3f, -2f, -1f, 0f, 1f, 2f }); | Tensor input = tf.constant(new float[] { -3f, -2f, -1f, 0f, 1f, 2f }); | ||||
| Tensor output = keras.layers.Softplus().Apply(input); | Tensor output = keras.layers.Softplus().Apply(input); | ||||
| NDArray expected = new NDArray(new float[] { 0.04858733f, 0.12692805f, 0.31326166f, 0.6931472f, 1.3132616f, 2.126928f }); | NDArray expected = new NDArray(new float[] { 0.04858733f, 0.12692805f, 0.31326166f, 0.6931472f, 1.3132616f, 2.126928f }); | ||||
| Assert.AreEqual(expected, output.numpy()); | |||||
| Assert.IsTrue(expected == output.numpy()); | |||||
| } | } | ||||
| [TestMethod] | [TestMethod] | ||||
| @@ -94,7 +94,7 @@ namespace Tensorflow.Keras.UnitTest.Layers | |||||
| { 7.6400003f, 12.24f, 16.84f }, | { 7.6400003f, 12.24f, 16.84f }, | ||||
| { 14.24f, 22.84f, 31.439999f } | { 14.24f, 22.84f, 31.439999f } | ||||
| } }, dtype: np.float32); | } }, dtype: np.float32); | ||||
| Assert.AreEqual(expected, actual.numpy()); | |||||
| Assert.IsTrue(expected == actual.numpy()); | |||||
| } | } | ||||
| [TestMethod] | [TestMethod] | ||||
| @@ -39,7 +39,7 @@ public class LossesTest : EagerModeTestBase | |||||
| // Using 'none' reduction type. | // Using 'none' reduction type. | ||||
| bce = tf.keras.losses.BinaryCrossentropy(from_logits: true, reduction: Reduction.NONE); | bce = tf.keras.losses.BinaryCrossentropy(from_logits: true, reduction: Reduction.NONE); | ||||
| loss = bce.Call(y_true, y_pred); | loss = bce.Call(y_true, y_pred); | ||||
| Assert.AreEqual(new float[] { 0.23515666f, 1.4957594f }, loss.numpy()); | |||||
| Assert.IsTrue(new NDArray(new float[] { 0.23515666f, 1.4957594f }) == loss.numpy()); | |||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||