From 072c77707b19f29b14a614783da24ddef04ad68f Mon Sep 17 00:00:00 2001 From: Yaohui Liu Date: Sat, 29 Apr 2023 05:02:31 +0800 Subject: [PATCH] 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()) {