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