forked from SciSharp/Tensor.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog.cs
More file actions
30 lines (29 loc) · 1.5 KB
/
Copy pathLog.cs
File metadata and controls
30 lines (29 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Tensornet.Common;
namespace Tensornet.Math{
public static partial class MathT{
public static Tensor<double> Log(Tensor<double> inp, double y){
return OnElemOperation.Execute<double, double>(inp, x => System.Math.Log(y, x));
}
public static Tensor<float> Log(Tensor<float> inp, float y){
return OnElemOperation.Execute<float, float>(inp, x => System.MathF.Log(y, x));
}
public static Tensor<double> Log(Tensor<long> inp, double y){
return OnElemOperation.Execute<long, double>(inp, x => System.Math.Log(y, x));
}
public static Tensor<double> Log(Tensor<int> inp, double y){
return OnElemOperation.Execute<int, double>(inp, x => System.Math.Log(y, x));
}
public static Tensor<double> Log(double baseValue, Tensor<double> inp){
return OnElemOperation.Execute<double, double>(inp, x => System.Math.Log(x, baseValue));
}
public static Tensor<float> Log(float baseValue, Tensor<float> inp){
return OnElemOperation.Execute<float, float>(inp, x => System.MathF.Log(x, baseValue));
}
public static Tensor<double> Log(double baseValue, Tensor<long> inp){
return OnElemOperation.Execute<long, double>(inp, x => System.Math.Log(x, baseValue));
}
public static Tensor<double> Log(double baseValue, Tensor<int> inp){
return OnElemOperation.Execute<int, double>(inp, x => System.Math.Log(x, baseValue));
}
}
}