You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Numpy.cs 4.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Numerics;
  5. using System.Text;
  6. namespace Tensorflow.NumPy
  7. {
  8. public partial class np
  9. {
  10. /// <summary>
  11. /// A convenient alias for None, useful for indexing arrays.
  12. /// </summary>
  13. /// <remarks>https://docs.scipy.org/doc/numpy-1.17.0/reference/arrays.indexing.html<br></br><br></br>https://stackoverflow.com/questions/42190783/what-does-three-dots-in-python-mean-when-indexing-what-looks-like-a-number</remarks>
  14. public static readonly Slice newaxis = new Slice(null, null, 1) { IsNewAxis = true };
  15. // https://docs.scipy.org/doc/numpy-1.16.0/user/basics.types.html
  16. #region data type
  17. public static readonly TF_DataType @bool = TF_DataType.TF_BOOL;
  18. public static readonly TF_DataType @char = TF_DataType.TF_INT8;
  19. public static readonly TF_DataType @byte = TF_DataType.TF_INT8;
  20. public static readonly TF_DataType uint8 = TF_DataType.TF_UINT8;
  21. public static readonly TF_DataType ubyte = TF_DataType.TF_UINT8;
  22. public static readonly TF_DataType int16 = TF_DataType.TF_INT16;
  23. public static readonly TF_DataType uint16 = TF_DataType.TF_UINT16;
  24. public static readonly TF_DataType int32 = TF_DataType.TF_INT32;
  25. public static readonly TF_DataType uint32 = TF_DataType.TF_UINT32;
  26. public static readonly TF_DataType int64 = TF_DataType.TF_INT64;
  27. public static readonly TF_DataType uint64 = TF_DataType.TF_UINT64;
  28. public static readonly TF_DataType float32 = TF_DataType.TF_FLOAT;
  29. public static readonly TF_DataType float64 = TF_DataType.TF_DOUBLE;
  30. public static readonly TF_DataType @double = TF_DataType.TF_DOUBLE;
  31. public static readonly TF_DataType @decimal = TF_DataType.TF_DOUBLE;
  32. public static readonly TF_DataType complex_ = TF_DataType.TF_COMPLEX;
  33. public static readonly TF_DataType complex64 = TF_DataType.TF_COMPLEX64;
  34. public static readonly TF_DataType complex128 = TF_DataType.TF_COMPLEX128;
  35. #endregion
  36. public static double nan => double.NaN;
  37. public static double NAN => double.NaN;
  38. public static double NaN => double.NaN;
  39. public static double pi => Math.PI;
  40. public static double e => Math.E;
  41. public static double euler_gamma => 0.57721566490153286060651209008240243d;
  42. public static double inf => double.PositiveInfinity;
  43. public static double infty => double.PositiveInfinity;
  44. public static double Inf => double.PositiveInfinity;
  45. public static double NINF => double.NegativeInfinity;
  46. public static double PINF => double.PositiveInfinity;
  47. public static double Infinity => double.PositiveInfinity;
  48. public static double infinity => double.PositiveInfinity;
  49. public static bool array_equal(NDArray a, NDArray b)
  50. => a.Equals(b);
  51. public static NDArray concatenate(NDArray[] arrays, int axis = 0)
  52. => throw new NotImplementedException("");
  53. public static NDArray frombuffer(byte[] bytes, string dtype)
  54. => throw new NotImplementedException("");
  55. public static bool allclose(NDArray a, NDArray b, double rtol = 1.0E-5, double atol = 1.0E-8,
  56. bool equal_nan = false) => throw new NotImplementedException("");
  57. public static class random
  58. {
  59. public static NDArray permutation(int x)
  60. {
  61. throw new NotImplementedException("");
  62. }
  63. public static void shuffle(NDArray nd)
  64. {
  65. }
  66. public static NDArray rand(params int[] shape)
  67. => throw new NotImplementedException("");
  68. public static NDArray randint(long x)
  69. => throw new NotImplementedException("");
  70. public static NDArray RandomState(int x)
  71. => throw new NotImplementedException("");
  72. }
  73. public static NpzDictionary<T> Load_Npz<T>(byte[] bytes)
  74. where T : class, IList, ICloneable, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable
  75. {
  76. throw new NotImplementedException("");
  77. }
  78. }
  79. }