Browse Source

Merge pull request #9 from AsakusaRinne/add_cv_compatibility

ci: update release ci.
pull/1047/head
Rinne GitHub 2 years ago
parent
commit
1ff669a9a9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 13 deletions
  1. +5
    -4
      .github/workflows/build_and_test.yml
  2. +13
    -5
      .github/workflows/release.yml
  3. +1
    -1
      src/TensorflowNET.Hub/Tensorflow.Hub.csproj
  4. +1
    -1
      test/TensorFlowNET.Keras.UnitTest/Layers/ActivationTest.cs
  5. +1
    -1
      test/TensorFlowNET.Keras.UnitTest/Layers/AttentionTest.cs
  6. +1
    -1
      test/TensorFlowNET.Keras.UnitTest/Losses/LossesTest.cs

+ 5
- 4
.github/workflows/build_and_test.yml View File

@@ -8,6 +8,7 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
types: ["opened", "reopened", "synchronize", "ready_for_review", "auto_merge_enabled"]

jobs:
windows:
@@ -24,8 +25,8 @@ jobs:
run: dotnet restore
- name: Build CPU version
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
run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist
- name: install redist gpu for unit tests
@@ -51,8 +52,8 @@ jobs:
run: dotnet restore
- name: Build CPU version
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
run: dotnet remove helpers/Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist
- name: install redist gpu for unit tests


+ 13
- 5
.github/workflows/release.yml View File

@@ -1,6 +1,6 @@
name: release
name: auto-release

on:
on:
workflow_run:
workflows: ["build_and_test"]
types:
@@ -12,6 +12,7 @@ env:

jobs:
build:
if: ${{ github.event.label.name == 'auto-release'}}
runs-on: windows-latest

steps:
@@ -67,7 +68,8 @@ jobs:

- name: Pack packages
run: |
$LastTag = git describe --tags (git rev-list --tags --max-count=1);
git fetch;
$LastTag = git describe --tags;
echo "Last tag is: $LastTag";
$Version = ($LastTag).TrimStart('v');
echo "Publishing version: $Version";
@@ -88,5 +90,11 @@ jobs:
- name: Add myget nuget source
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

+ 1
- 1
src/TensorflowNET.Hub/Tensorflow.Hub.csproj View File

@@ -5,7 +5,7 @@
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>TensorFlow.NET.Hub</PackageId>
<PackageId>TensorFlow.Hub</PackageId>
<PackageLicenseExpression>Apache2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<SignAssembly>true</SignAssembly>


+ 1
- 1
test/TensorFlowNET.Keras.UnitTest/Layers/ActivationTest.cs View File

@@ -49,7 +49,7 @@ namespace Tensorflow.Keras.UnitTest.Layers
Tensor input = tf.constant(new float[] { -3f, -2f, -1f, 0f, 1f, 2f });
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 });
Assert.AreEqual(expected, output.numpy());
Assert.IsTrue(expected == output.numpy());
}

[TestMethod]


+ 1
- 1
test/TensorFlowNET.Keras.UnitTest/Layers/AttentionTest.cs View File

@@ -94,7 +94,7 @@ namespace Tensorflow.Keras.UnitTest.Layers
{ 7.6400003f, 12.24f, 16.84f },
{ 14.24f, 22.84f, 31.439999f }
} }, dtype: np.float32);
Assert.AreEqual(expected, actual.numpy());
Assert.IsTrue(expected == actual.numpy());
}

[TestMethod]


+ 1
- 1
test/TensorFlowNET.Keras.UnitTest/Losses/LossesTest.cs View File

@@ -39,7 +39,7 @@ public class LossesTest : EagerModeTestBase
// Using 'none' reduction type.
bce = tf.keras.losses.BinaryCrossentropy(from_logits: true, reduction: Reduction.NONE);
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>


Loading…
Cancel
Save