| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f32314e commit 83151d2
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -245,10 +245,7 @@ public Tensor less_equal<Tx, Ty>(Tx x, Ty y, string name = null) | |||
| 245 | 245 | public Tensor log1p(Tensor x, string name = null) | |
| 246 | 246 | => gen_math_ops.log1p(x, name); | |
| 247 | 247 | ||
| 248 | - public Tensor logical_and(Tensor x, Tensor y, string name = null) | ||
| 249 | - => gen_math_ops.logical_and(x, y, name); | ||
| 250 | - | ||
| 251 | - public Tensor logical_and(bool x, bool y, string name = null) | ||
| 248 | + public Tensor logical_and<T>(T x, T y, string name = null) | ||
| 252 | 249 | => gen_math_ops.logical_and(x, y, name); | |
| 253 | 250 | ||
| 254 | 251 | public Tensor logical_not(Tensor x, string name = null) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,9 @@ public record Axis(params int[] axis) | |||
| 30 | 30 | public static implicit operator int[]?(Axis axis) | |
| 31 | 31 | => axis?.axis; | |
| 32 | 32 | ||
| 33 | + public static implicit operator int(Axis axis) | ||
| 34 | + => axis.axis[0]; | ||
| 35 | + | ||
| 33 | 36 | public static implicit operator Axis(int axis) | |
| 34 | 37 | => new Axis(axis); | |
| 35 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,5 +12,7 @@ public partial class NDArray | |||
| 12 | 12 | public static NDArray operator -(NDArray lhs, NDArray rhs) => lhs.Tensor - rhs.Tensor; | |
| 13 | 13 | public static NDArray operator *(NDArray lhs, NDArray rhs) => lhs.Tensor * rhs.Tensor; | |
| 14 | 14 | public static NDArray operator /(NDArray lhs, NDArray rhs) => lhs.Tensor / rhs.Tensor; | |
| 15 | + public static NDArray operator >(NDArray lhs, NDArray rhs) => lhs.Tensor > rhs.Tensor; | ||
| 16 | + public static NDArray operator <(NDArray lhs, NDArray rhs) => lhs.Tensor < rhs.Tensor; | ||
| 15 | 17 | } | |
| 16 | 18 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 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 | + | ||
| 8 | + namespace Tensorflow.NumPy | ||
| 9 | + { | ||
| 10 | + public partial class np | ||
| 11 | + { | ||
| 12 | + public static NDArray logical_or(NDArray x1, NDArray x2) | ||
| 13 | + => tf.logical_or(x1, x2); | ||
| 14 | + | ||
| 15 | + public static NDArray logical_and(NDArray x1, NDArray x2) | ||
| 16 | + => tf.logical_and(x1, x2); | ||
| 17 | + } | ||
| 18 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + using System; | ||
| 2 | + using System.Collections; | ||
| 3 | + using System.Collections.Generic; | ||
| 4 | + using System.Numerics; | ||
| 5 | + using System.Text; | ||
| 6 | + | ||
| 7 | + namespace Tensorflow.NumPy | ||
| 8 | + { | ||
| 9 | + public partial class np | ||
| 10 | + { | ||
| 11 | + public static NDArray argmax(NDArray a, Axis axis = null) | ||
| 12 | + => new NDArray(math_ops.argmax(a, axis)); | ||
| 13 | + | ||
| 14 | + public static NDArray argsort(NDArray a, Axis axis = null) | ||
| 15 | + => new NDArray(math_ops.argmax(a, axis ?? -1)); | ||
| 16 | + | ||
| 17 | + public static NDArray unique(NDArray a) | ||
| 18 | + => throw new NotImplementedException(""); | ||
| 19 | + } | ||
| 20 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 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 | + | ||
| 8 | + namespace Tensorflow.NumPy | ||
| 9 | + { | ||
| 10 | + public partial class np | ||
| 11 | + { | ||
| 12 | + public static NDArray amin(NDArray x, int axis = 0) | ||
| 13 | + => tf.arg_min(x, axis); | ||
| 14 | + | ||
| 15 | + public static NDArray amax(NDArray x, int axis = 0) | ||
| 16 | + => tf.arg_max(x, axis); | ||
| 17 | + } | ||
| 18 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,9 @@ namespace Tensorflow.NumPy | |||
| 8 | 8 | { | |
| 9 | 9 | public partial class np | |
| 10 | 10 | { | |
| 11 | + public static NDArray reshape(NDArray x1, Shape newshape) | ||
| 12 | + => x1.reshape(newshape); | ||
| 13 | + | ||
| 11 | 14 | public static NDArray squeeze(NDArray x1, Axis? axis = null) | |
| 12 | 15 | => new NDArray(array_ops.squeeze(x1, axis)); | |
| 13 | 16 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,17 +9,29 @@ namespace Tensorflow.NumPy | |||
| 9 | 9 | { | |
| 10 | 10 | public partial class np | |
| 11 | 11 | { | |
| 12 | + public static NDArray exp(NDArray x) | ||
| 13 | + => tf.exp(x); | ||
| 14 | + | ||
| 12 | 15 | public static NDArray log(NDArray x) | |
| 13 | 16 | => tf.log(x); | |
| 14 | 17 | ||
| 18 | + public static NDArray multiply(NDArray x1, NDArray x2) | ||
| 19 | + => tf.multiply(x1, x2); | ||
| 20 | + | ||
| 21 | + public static NDArray maximum(NDArray x1, NDArray x2) | ||
| 22 | + => tf.maximum(x1, x2); | ||
| 23 | + | ||
| 24 | + public static NDArray minimum(NDArray x1, NDArray x2) | ||
| 25 | + => tf.minimum(x1, x2); | ||
| 26 | + | ||
| 15 | 27 | public static NDArray prod(NDArray array, Axis? axis = null, Type? dtype = null, bool keepdims = false) | |
| 16 | 28 | => tf.reduce_prod(array, axis: axis); | |
| 17 | 29 | ||
| 18 | 30 | public static NDArray prod<T>(params T[] array) where T : unmanaged | |
| 19 | 31 | => tf.reduce_prod(ops.convert_to_tensor(array)); | |
| 20 | 32 | ||
| 21 | - public static NDArray multiply(NDArray x1, NDArray x2) | ||
| 22 | - => tf.multiply(x1, x2); | ||
| 33 | + public static NDArray sqrt(NDArray x) | ||
| 34 | + => tf.sqrt(x); | ||
| 23 | 35 | ||
| 24 | 36 | public static NDArray sum(NDArray x1, Axis? axis = null) | |
| 25 | 37 | => tf.math.sum(x1, axis); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,9 @@ public static NDArray load(string file) | |||
| 46 | 46 | public static (NDArray, NDArray) meshgrid<T>(T x, T y, bool copy = true, bool sparse = false) | |
| 47 | 47 | => tf.numpy.meshgrid(new[] { x, y }, copy: copy, sparse: sparse); | |
| 48 | 48 | ||
| 49 | + public static NDArray ndarray(Shape shape, TF_DataType dtype = TF_DataType.TF_DOUBLE) | ||
| 50 | + => new NDArray(tf.zeros(shape, dtype: dtype)); | ||
| 51 | + | ||
| 49 | 52 | public static NDArray ones(Shape shape, TF_DataType dtype = TF_DataType.TF_DOUBLE) | |
| 50 | 53 | => new NDArray(tf.ones(shape, dtype: dtype)); | |
| 51 | 54 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ public static Tensor add_n(Tensor[] inputs, string name = null) | |||
| 50 | 50 | /// <param name="output_type"></param> | |
| 51 | 51 | /// <param name="name"></param> | |
| 52 | 52 | /// <returns></returns> | |
| 53 | - public static Tensor arg_max(Tensor input, int dimension, TF_DataType output_type = TF_DataType.TF_INT64, string name = null) | ||
| 53 | + public static Tensor arg_max(Tensor input, Axis dimension, TF_DataType output_type = TF_DataType.TF_INT64, string name = null) | ||
| 54 | 54 | => tf.Context.ExecuteOp("ArgMax", name, new ExecuteOpArgs(input, dimension) | |
| 55 | 55 | .SetAttributes(new { output_type })); | |
| 56 | 56 | ||
@@ -308,10 +308,7 @@ public static Tensor less_equal<Tx, Ty>(Tx x, Ty y, string name = null) | |||
| 308 | 308 | public static Tensor log1p(Tensor x, string name = null) | |
| 309 | 309 | => tf.Context.ExecuteOp("Log1p", name, new ExecuteOpArgs(x)); | |
| 310 | 310 | ||
| 311 | - public static Tensor logical_and(Tensor x, Tensor y, string name = null) | ||
| 312 | - => tf.Context.ExecuteOp("LogicalAnd", name, new ExecuteOpArgs(x, y)); | ||
| 313 | - | ||
| 314 | - public static Tensor logical_and(bool x, bool y, string name = null) | ||
| 311 | + public static Tensor logical_and<T>(T x, T y, string name = null) | ||
| 315 | 312 | => tf.Context.ExecuteOp("LogicalAnd", name, new ExecuteOpArgs(x, y)); | |
| 316 | 313 | ||
| 317 | 314 | public static Tensor logical_not(Tensor x, string name = null) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments