forked from SciSharp/Tensor.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbs.cs
More file actions
21 lines (20 loc) · 882 Bytes
/
Copy pathAbs.cs
File metadata and controls
21 lines (20 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Tensornet.Common;
namespace Tensornet.Math{
public static class AbsExtension{
public static Tensor<double> Add(this Tensor<double> inp){
return OnElemOperation.Execute<double, double>(inp, x => System.Math.Abs(x));
}
public static Tensor<float> Add(this Tensor<float> inp){
return OnElemOperation.Execute<float, float>(inp, x => System.Math.Abs(x));
}
public static Tensor<long> Add(this Tensor<long> inp){
return OnElemOperation.Execute<long, long>(inp, x => System.Math.Abs(x));
}
public static Tensor<int> Add(this Tensor<int> inp){
return OnElemOperation.Execute<int, int>(inp, x => System.Math.Abs(x));
}
public static Tensor<bool> Add(this Tensor<bool> inp){
return OnElemOperation.Execute<bool, bool>(inp, x => x);
}
}
}