SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.37k stars 192 forks source link

linspace to Array as type float, while other functions as type double #487

Open changjian-github opened 1 year ago

changjian-github commented 1 year ago
using NumSharp;

class Program
{
  static void Main(string[] args)
  {
    double[] x = np.arange(-1, 1.1, 0.1).ToArray<double>();
    float[] y = np.linspace(-1, 1, 21).ToArray<float>();
    double[] z = np.random.rand(21).ToArray<double>();
    Console.WriteLine("compile passed");
  }
}

Changing float to double will result in an error.