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.Math.cs 1.9 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Numerics;
  5. using System.Text;
  6. using static Tensorflow.Binding;
  7. namespace Tensorflow.NumPy
  8. {
  9. public partial class np
  10. {
  11. [AutoNumPy]
  12. public static NDArray cos(NDArray x) => new NDArray(math_ops.cos(x));
  13. [AutoNumPy]
  14. public static NDArray exp(NDArray x) => new NDArray(tf.exp(x));
  15. [AutoNumPy]
  16. public static NDArray floor(NDArray x) => new NDArray(math_ops.floor(x));
  17. [AutoNumPy]
  18. public static NDArray log(NDArray x) => new NDArray(tf.log(x));
  19. [AutoNumPy]
  20. public static NDArray mean(NDArray x) => new NDArray(math_ops.reduce_mean(x));
  21. [AutoNumPy]
  22. public static NDArray multiply(NDArray x1, NDArray x2) => new NDArray(tf.multiply(x1, x2));
  23. [AutoNumPy]
  24. public static NDArray maximum(NDArray x1, NDArray x2) => new NDArray(tf.maximum(x1, x2));
  25. [AutoNumPy]
  26. public static NDArray minimum(NDArray x1, NDArray x2) => new NDArray(tf.minimum(x1, x2));
  27. [AutoNumPy]
  28. public static NDArray prod(NDArray array, Axis? axis = null, Type? dtype = null, bool keepdims = false)
  29. => new NDArray(tf.reduce_prod(array, axis: axis));
  30. [AutoNumPy]
  31. public static NDArray prod<T>(params T[] array) where T : unmanaged
  32. => new NDArray(tf.reduce_prod(new NDArray(array)));
  33. [AutoNumPy]
  34. public static NDArray power(NDArray x, NDArray y) => new NDArray(tf.pow(x, y));
  35. [AutoNumPy]
  36. public static NDArray sin(NDArray x) => new NDArray(math_ops.sin(x));
  37. [AutoNumPy]
  38. public static NDArray sqrt(NDArray x) => new NDArray(tf.sqrt(x));
  39. [AutoNumPy]
  40. public static NDArray sum(NDArray x1, Axis? axis = null) => new NDArray(tf.math.sum(x1, axis));
  41. }
  42. }