| @@ -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 | namespace Tensorflow.NumPy | ||||
| { | { | ||||
| @@ -14,24 +10,24 @@ namespace Tensorflow.NumPy | |||||
| public static NDArray operator -(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("sub", lhs, rhs)); | public static NDArray operator -(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("sub", lhs, rhs)); | ||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray operator *(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("mul", lhs, rhs)); | 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)); | public static NDArray operator /(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("div", lhs, rhs)); | ||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray operator %(NDArray lhs, NDArray rhs) => new NDArray(BinaryOpWrapper("mod", lhs, rhs)); | 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)); | 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)); | 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)); | public static NDArray operator -(NDArray lhs) => new NDArray(gen_math_ops.neg(lhs)); | ||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray operator ==(NDArray lhs, NDArray rhs) | public static NDArray operator ==(NDArray lhs, NDArray rhs) | ||||
| { | { | ||||
| if(ReferenceEquals(lhs, rhs)) | |||||
| if (ReferenceEquals(lhs, rhs)) | |||||
| return Scalar(true); | return Scalar(true); | ||||
| if(lhs is null) | |||||
| if (lhs is null) | |||||
| return Scalar(false); | return Scalar(false); | ||||
| if(rhs is null) | |||||
| if (rhs is null) | |||||
| return Scalar(false); | return Scalar(false); | ||||
| // TODO(Rinne): use np.allclose instead. | // TODO(Rinne): use np.allclose instead. | ||||
| if (lhs.dtype.is_floating() || rhs.dtype.is_floating()) | if (lhs.dtype.is_floating() || rhs.dtype.is_floating()) | ||||
| @@ -47,9 +43,9 @@ namespace Tensorflow.NumPy | |||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray operator !=(NDArray lhs, NDArray rhs) | public static NDArray operator !=(NDArray lhs, NDArray rhs) | ||||
| { | { | ||||
| if(ReferenceEquals(lhs, rhs)) | |||||
| if (ReferenceEquals(lhs, rhs)) | |||||
| return Scalar(false); | return Scalar(false); | ||||
| if(lhs is null || rhs is null) | |||||
| if (lhs is null || rhs is null) | |||||
| return Scalar(true); | return Scalar(true); | ||||
| if (lhs.dtype.is_floating() || rhs.dtype.is_floating()) | if (lhs.dtype.is_floating() || rhs.dtype.is_floating()) | ||||
| { | { | ||||