Skip to content

Commit d10aa8a

Browse files
committed
doc(csharp/Tensor.NET): add comments for public apis.
1 parent 18bbc45 commit d10aa8a

36 files changed

+891
-286
lines changed
File renamed without changes.

csharp/Tensor.NET/Algebra/Dot.cs

Lines changed: 154 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,222 @@
44

55
namespace Tensornet{
66
public static class DotExtension{
7+
/// <summary>
8+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
9+
/// </summary>
10+
/// <typeparam name="T"></typeparam>
11+
/// <param name="lhs"></param>
12+
/// <param name="rhs"></param>
13+
/// <returns></returns>
714
public static Tensor<T> Dot<T>(this Tensor<T> lhs, Tensor<T> rhs) where T : struct, IEquatable<T>, IConvertible{
815
return DotInternal<T, T, T>(lhs, rhs);
916
}
17+
/// <summary>
18+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
19+
/// </summary>
20+
/// <typeparam name="T"></typeparam>
21+
/// <param name="lhs"></param>
22+
/// <param name="rhs"></param>
23+
/// <returns></returns>
1024
public static Tensor<double> Dot(this Tensor<double> lhs, Tensor<int> rhs){
1125
return DotInternal<double, int, double>(lhs, rhs);
12-
}
26+
}/// <summary>
27+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
28+
/// </summary>
29+
/// <typeparam name="T"></typeparam>
30+
/// <param name="lhs"></param>
31+
/// <param name="rhs"></param>
32+
/// <returns></returns>
1333
public static Tensor<double> Dot(this Tensor<double> lhs, Tensor<float> rhs){
1434
return DotInternal<double, float, double>(lhs, rhs);
1535
}
36+
/// <summary>
37+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
38+
/// </summary>
39+
/// <typeparam name="T"></typeparam>
40+
/// <param name="lhs"></param>
41+
/// <param name="rhs"></param>
42+
/// <returns></returns>
1643
public static Tensor<double> Dot(this Tensor<double> lhs, Tensor<long> rhs){
1744
return DotInternal<double, long, double>(lhs, rhs);
1845
}
46+
/// <summary>
47+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
48+
/// </summary>
49+
/// <typeparam name="T"></typeparam>
50+
/// <param name="lhs"></param>
51+
/// <param name="rhs"></param>
52+
/// <returns></returns>
1953
public static Tensor<double> Dot(this Tensor<double> lhs, Tensor<bool> rhs){
2054
return DotInternal<double, bool, double>(lhs, rhs);
2155
}
56+
/// <summary>
57+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
58+
/// </summary>
59+
/// <typeparam name="T"></typeparam>
60+
/// <param name="lhs"></param>
61+
/// <param name="rhs"></param>
62+
/// <returns></returns>
2263
public static Tensor<double> Dot(this Tensor<int> lhs, Tensor<double> rhs){
2364
return DotInternal<int, double, double>(lhs, rhs);
2465
}
66+
/// <summary>
67+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
68+
/// </summary>
69+
/// <typeparam name="T"></typeparam>
70+
/// <param name="lhs"></param>
71+
/// <param name="rhs"></param>
72+
/// <returns></returns>
2573
public static Tensor<float> Dot(this Tensor<int> lhs, Tensor<float> rhs){
2674
return DotInternal<int, float, float>(lhs, rhs);
2775
}
76+
/// <summary>
77+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
78+
/// </summary>
79+
/// <typeparam name="T"></typeparam>
80+
/// <param name="lhs"></param>
81+
/// <param name="rhs"></param>
82+
/// <returns></returns>
2883
public static Tensor<long> Dot(this Tensor<int> lhs, Tensor<long> rhs){
2984
return DotInternal<int, long, long>(lhs, rhs);
3085
}
86+
/// <summary>
87+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
88+
/// </summary>
89+
/// <typeparam name="T"></typeparam>
90+
/// <param name="lhs"></param>
91+
/// <param name="rhs"></param>
92+
/// <returns></returns>
3193
public static Tensor<int> Dot(this Tensor<int> lhs, Tensor<bool> rhs){
3294
return DotInternal<int, bool, int>(lhs, rhs);
3395
}
96+
/// <summary>
97+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
98+
/// </summary>
99+
/// <typeparam name="T"></typeparam>
100+
/// <param name="lhs"></param>
101+
/// <param name="rhs"></param>
102+
/// <returns></returns>
34103
public static Tensor<double> Dot(this Tensor<long> lhs, Tensor<double> rhs){
35104
return DotInternal<long, double, double>(lhs, rhs);
36105
}
106+
/// <summary>
107+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
108+
/// </summary>
109+
/// <typeparam name="T"></typeparam>
110+
/// <param name="lhs"></param>
111+
/// <param name="rhs"></param>
112+
/// <returns></returns>
37113
public static Tensor<float> Dot(this Tensor<long> lhs, Tensor<float> rhs){
38114
return DotInternal<long, float, float>(lhs, rhs);
39115
}
116+
/// <summary>
117+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
118+
/// </summary>
119+
/// <typeparam name="T"></typeparam>
120+
/// <param name="lhs"></param>
121+
/// <param name="rhs"></param>
122+
/// <returns></returns>
40123
public static Tensor<long> Dot(this Tensor<long> lhs, Tensor<int> rhs){
41124
return DotInternal<long, int, long>(lhs, rhs);
42125
}
126+
/// <summary>
127+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
128+
/// </summary>
129+
/// <typeparam name="T"></typeparam>
130+
/// <param name="lhs"></param>
131+
/// <param name="rhs"></param>
132+
/// <returns></returns>
43133
public static Tensor<long> Dot(this Tensor<long> lhs, Tensor<bool> rhs){
44134
return DotInternal<long, bool, long>(lhs, rhs);
45135
}
136+
/// <summary>
137+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
138+
/// </summary>
139+
/// <typeparam name="T"></typeparam>
140+
/// <param name="lhs"></param>
141+
/// <param name="rhs"></param>
142+
/// <returns></returns>
46143
public static Tensor<float> Dot(this Tensor<float> lhs, Tensor<long> rhs){
47144
return DotInternal<float, long, float>(lhs, rhs);
48145
}
146+
/// <summary>
147+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
148+
/// </summary>
149+
/// <typeparam name="T"></typeparam>
150+
/// <param name="lhs"></param>
151+
/// <param name="rhs"></param>
152+
/// <returns></returns>
49153
public static Tensor<float> Dot(this Tensor<float> lhs, Tensor<int> rhs){
50154
return DotInternal<float, int, float>(lhs, rhs);
51155
}
156+
/// <summary>
157+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
158+
/// </summary>
159+
/// <typeparam name="T"></typeparam>
160+
/// <param name="lhs"></param>
161+
/// <param name="rhs"></param>
162+
/// <returns></returns>
52163
public static Tensor<float> Dot(this Tensor<float> lhs, Tensor<bool> rhs){
53164
return DotInternal<float, bool, float>(lhs, rhs);
54165
}
166+
/// <summary>
167+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
168+
/// </summary>
169+
/// <typeparam name="T"></typeparam>
170+
/// <param name="lhs"></param>
171+
/// <param name="rhs"></param>
172+
/// <returns></returns>
55173
public static Tensor<double> Dot(this Tensor<float> lhs, Tensor<double> rhs){
56174
return DotInternal<float, double, double>(lhs, rhs);
57175
}
176+
/// <summary>
177+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
178+
/// </summary>
179+
/// <typeparam name="T"></typeparam>
180+
/// <param name="lhs"></param>
181+
/// <param name="rhs"></param>
182+
/// <returns></returns>
58183
public static Tensor<double> Dot(this Tensor<bool> lhs, Tensor<double> rhs){
59184
return DotInternal<bool, double, double>(lhs, rhs);
60185
}
186+
/// <summary>
187+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
188+
/// </summary>
189+
/// <typeparam name="T"></typeparam>
190+
/// <param name="lhs"></param>
191+
/// <param name="rhs"></param>
192+
/// <returns></returns>
61193
public static Tensor<float> Dot(this Tensor<bool> lhs, Tensor<float> rhs){
62194
return DotInternal<bool, float, float>(lhs, rhs);
63195
}
196+
/// <summary>
197+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
198+
/// </summary>
199+
/// <typeparam name="T"></typeparam>
200+
/// <param name="lhs"></param>
201+
/// <param name="rhs"></param>
202+
/// <returns></returns>
64203
public static Tensor<long> Dot(this Tensor<bool> lhs, Tensor<long> rhs){
65204
return DotInternal<bool, long, long>(lhs, rhs);
66205
}
206+
/// <summary>
207+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
208+
/// </summary>
209+
/// <typeparam name="T"></typeparam>
210+
/// <param name="lhs"></param>
211+
/// <param name="rhs"></param>
212+
/// <returns></returns>
67213
public static Tensor<int> Dot(this Tensor<bool> lhs, Tensor<int> rhs){
68214
return DotInternal<bool, int, int>(lhs, rhs);
69215
}
216+
/// <summary>
217+
/// Get the dot result of the two tensors. For the details, please refer to https://numpy.org/doc/stable/reference/generated/numpy.dot.html#numpy.dot
218+
/// </summary>
219+
/// <typeparam name="T"></typeparam>
220+
/// <param name="lhs"></param>
221+
/// <param name="rhs"></param>
222+
/// <returns></returns>
70223
private static Tensor<TC> DotInternal<TA, TB, TC>(Tensor<TA> lhs, Tensor<TB> rhs)
71224
where TA : struct, IEquatable<TA>, IConvertible
72225
where TB : struct, IEquatable<TB>, IConvertible

0 commit comments

Comments
 (0)