forked from SciSharp/Tensor.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExp.cs
More file actions
21 lines (20 loc) · 893 Bytes
/
Copy pathExp.cs
File metadata and controls
21 lines (20 loc) · 893 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 partial class MathT{
public static Tensor<double> Exp(Tensor<double> inp){
return OnElemOperation.Execute<double, double>(inp, x => System.Math.Exp(x));
}
public static Tensor<float> Exp(Tensor<float> inp){
return OnElemOperation.Execute<float, float>(inp, x => System.MathF.Exp(x));
}
public static Tensor<double> Exp(Tensor<long> inp){
return OnElemOperation.Execute<long, double>(inp, x => System.Math.Exp(x));
}
public static Tensor<double> Exp(Tensor<int> inp){
return OnElemOperation.Execute<int, double>(inp, x => System.Math.Exp(x));
}
public static Tensor<double> Exp(Tensor<bool> inp){
return OnElemOperation.Execute<bool, double>(inp, x => x ? System.Math.E : 1);
}
}
}