We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60479a4 commit 18bbc45Copy full SHA for 18bbc45
csharp/Tensor.NET/Operators/And.cs
@@ -0,0 +1,15 @@
1
+using Tensornet.Common;
2
+
3
+namespace Tensornet{
4
+ public partial class Tensor<T>{
5
+ public static Tensor<T> operator&(Tensor<T> lhs, Tensor<T> rhs){
6
+ return InterElemOperation.Execute<T>(lhs, rhs, InterElemOperationType.And);
7
+ }
8
+ public static Tensor<T> operator&(Tensor<T> lhs, T rhs){
9
+ return InterElemOperation.Execute<T>(lhs, (Tensor<T>)rhs, InterElemOperationType.And);
10
11
+ public static Tensor<T> operator&(T lhs, Tensor<T> rhs){
12
+ return InterElemOperation.Execute<T>((Tensor<T>)lhs, rhs, InterElemOperationType.And);
13
14
15
+}
csharp/Tensor.NET/Operators/Mod.cs
+ public static Tensor<T> operator%(Tensor<T> lhs, Tensor<T> rhs){
+ return InterElemOperation.Execute<T>(lhs, rhs, InterElemOperationType.Mod);
+ public static Tensor<T> operator%(Tensor<T> lhs, T rhs){
+ return InterElemOperation.Execute<T>(lhs, (Tensor<T>)rhs, InterElemOperationType.Mod);
+ public static Tensor<T> operator%(T lhs, Tensor<T> rhs){
+ return InterElemOperation.Execute<T>((Tensor<T>)lhs, rhs, InterElemOperationType.Mod);
csharp/Tensor.NET/Operators/Or.cs
+ public static Tensor<T> operator|(Tensor<T> lhs, Tensor<T> rhs){
+ return InterElemOperation.Execute<T>(lhs, rhs, InterElemOperationType.Or);
+ public static Tensor<T> operator|(Tensor<T> lhs, T rhs){
+ return InterElemOperation.Execute<T>(lhs, (Tensor<T>)rhs, InterElemOperationType.Or);
+ public static Tensor<T> operator|(T lhs, Tensor<T> rhs){
+ return InterElemOperation.Execute<T>((Tensor<T>)lhs, rhs, InterElemOperationType.Or);
csharp/Tensor.NET/Operators/Xor.cs
+ public static Tensor<T> operator^(Tensor<T> lhs, Tensor<T> rhs){
+ return InterElemOperation.Execute<T>(lhs, rhs, InterElemOperationType.Xor);
+ public static Tensor<T> operator^(Tensor<T> lhs, T rhs){
+ return InterElemOperation.Execute<T>(lhs, (Tensor<T>)rhs, InterElemOperationType.Xor);
+ public static Tensor<T> operator^(T lhs, Tensor<T> rhs){
+ return InterElemOperation.Execute<T>((Tensor<T>)lhs, rhs, InterElemOperationType.Xor);
csharp/Tensor.NET/Tensor/Common/InterElemOperation.cs
@@ -7,7 +7,11 @@ internal enum InterElemOperationType{
Add = 1,
Sub = 2,
Mul = 3,
- Div = 4
+ Div = 4,
+ Mod = 5,
+ And = 6,
+ Or = 7,
+ Xor = 8
}
16
internal static class InterElemOperation{
17
public static unsafe Tensor<T> Execute<T>(Tensor<T> a, Tensor<T> b, InterElemOperationType operationType)
doc/TODO.md
@@ -55,7 +55,7 @@
55
| Add zeros_like, ones_like, fill_like methods | | p0 | Complete ✅ |
56
| Add flatten method | | p0 | Complete ✅ |
57
| Add max, min, mean op | | p0 | Complete ✅ |
58
-| Add mod, and, or, xor operators in csharp | | p0 | Waiting 🔵 |
+| Add mod, and, or, xor operators in csharp | | p0 | Complete ✅ |
59
60
61
✅ ❌ 🚀 🔵
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments