Browse Source

Merge pull request #8 from AsakusaRinne/add_cv_compatibility

fix: run code clean.
pull/1047/head
Rinne GitHub 2 years ago
parent
commit
62cb134939
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 19 deletions
  1. +2
    -2
      .github/workflows/build_and_test.yml
  2. +2
    -1
      .github/workflows/release.yml
  3. +0
    -2
      .github/workflows/semantic.yml
  4. +10
    -14
      src/TensorFlowNET.Core/NumPy/NDArray.Operators.cs

+ 2
- 2
.github/workflows/build_and_test.yml View File

@@ -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



+ 2
- 1
.github/workflows/release.yml View File

@@ -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



+ 0
- 2
.github/workflows/semantic.yml View File

@@ -1,8 +1,6 @@
name: Semantic

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]



+ 10
- 14
src/TensorFlowNET.Core/NumPy/NDArray.Operators.cs View File

@@ -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())
{


Loading…
Cancel
Save