From 072c77707b19f29b14a614783da24ddef04ad68f Mon Sep 17 00:00:00 2001 From: Yaohui Liu Date: Sat, 29 Apr 2023 05:02:31 +0800 Subject: [PATCH 1/2] fix: run code clean. --- .../NumPy/NDArray.Operators.cs | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/TensorFlowNET.Core/NumPy/NDArray.Operators.cs b/src/TensorFlowNET.Core/NumPy/NDArray.Operators.cs index 1149b798..dd457709 100644 --- a/src/TensorFlowNET.Core/NumPy/NDArray.Operators.cs +++ b/src/TensorFlowNET.Core/NumPy/NDArray.Operators.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using static Tensorflow.Binding; +using static Tensorflow.Binding; namespace Tensorflow.NumPy { @@ -14,24 +10,24 @@ namespace Tensorflow.NumPy public static NDArray operator -(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("sub", lhs, rhs)); [AutoNumPy] public static NDArray operator *(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("mul", lhs, rhs)); - [AutoNumPy] + [AutoNumPy] public static NDArray operator /(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("div", lhs, rhs)); [AutoNumPy] public static NDArray operator %(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("mod", lhs, rhs)); - [AutoNumPy] + [AutoNumPy] public static NDArray operator >(NDArray lhs, NDArray rhs) => new NDArray(gen_math_ops.greater(lhs, rhs)); - [AutoNumPy] + [AutoNumPy] public static NDArray operator <(NDArray lhs, NDArray rhs) => new NDArray(gen_math_ops.less(lhs, rhs)); - [AutoNumPy] + [AutoNumPy] public static NDArray operator -(NDArray lhs) => new NDArray(gen_math_ops.neg(lhs)); [AutoNumPy] public static NDArray operator ==(NDArray lhs, NDArray rhs) { - if(ReferenceEquals(lhs, rhs)) + if (ReferenceEquals(lhs, rhs)) return Scalar(true); - if(lhs is null) + if (lhs is null) return Scalar(false); - if(rhs is null) + if (rhs is null) return Scalar(false); // TODO(Rinne): use np.allclose instead. if (lhs.dtype.is_floating() || rhs.dtype.is_floating()) @@ -47,9 +43,9 @@ namespace Tensorflow.NumPy [AutoNumPy] public static NDArray operator !=(NDArray lhs, NDArray rhs) { - if(ReferenceEquals(lhs, rhs)) + if (ReferenceEquals(lhs, rhs)) return Scalar(false); - if(lhs is null || rhs is null) + if (lhs is null || rhs is null) return Scalar(true); if (lhs.dtype.is_floating() || rhs.dtype.is_floating()) { From 0301f5f9b463caa6d53c2c47018ec9eb2403cee1 Mon Sep 17 00:00:00 2001 From: AsakusaRinne Date: Sat, 29 Apr 2023 07:56:53 +0800 Subject: [PATCH 2/2] ci: revise the auto release ci. --- .github/workflows/build_and_test.yml | 4 ++-- .github/workflows/release.yml | 3 ++- .github/workflows/semantic.yml | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f4a072f9..ae6b7e63 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -10,7 +10,7 @@ on: branches: [ "master" ] jobs: - build-and-test-on-windows: + windows: runs-on: windows-latest @@ -37,7 +37,7 @@ jobs: # - name: Test GPU version # run: dotnet test --no-build --verbosity normal - build-and-test-on-linux: + linux: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5b0075d..5afef6f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,8 +50,9 @@ jobs: needs: build steps: + - uses: actions/checkout@v3 - name: Setup .NET 6.0.x SDK - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml index ffd5c125..db8c06a3 100644 --- a/.github/workflows/semantic.yml +++ b/.github/workflows/semantic.yml @@ -1,8 +1,6 @@ name: Semantic on: - push: - branches: [ "master" ] pull_request: branches: [ "master" ]