| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8784c31 commit 22effd6
164 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,7 +151,7 @@ public Action<int, int> Conv2DWithVariable | |||
| 151 | 151 | public Action<int, int> Dataset | |
| 152 | 152 | => (epoch, iterate) => | |
| 153 | 153 | { | |
| 154 | - TensorShape shape = (16, 32, 32, 3); | ||
| 154 | + Shape shape = (16, 32, 32, 3); | ||
| 155 | 155 | var images = np.arange(shape.size).astype(np.float32).reshape(shape.dims); | |
| 156 | 156 | var data_handler = new DataHandler(new DataHandlerArgs | |
| 157 | 157 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ public Action<int, int> ConcreteFunction | |||
| 22 | 22 | ||
| 23 | 23 | Tensor permutation(Tensor tensor) | |
| 24 | 24 | { | |
| 25 | - TensorShape shape = (8, 64, 64, 3); | ||
| 25 | + Shape shape = (8, 64, 64, 3); | ||
| 26 | 26 | var images = np.arange(shape.size).astype(np.float32).reshape(shape.dims); | |
| 27 | 27 | return tf.constant(images); | |
| 28 | 28 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ public Action<int, int> Conv2DLayer | |||
| 19 | 19 | public Action<int, int> InputLayer | |
| 20 | 20 | => (epoch, iterate) => | |
| 21 | 21 | { | |
| 22 | - TensorShape shape = (32, 256, 256, 3); // 48M | ||
| 22 | + Shape shape = (32, 256, 256, 3); // 48M | ||
| 23 | 23 | var images = np.arange(shape.size).astype(np.float32).reshape(shape.dims); | |
| 24 | 24 | ||
| 25 | 25 | var inputs = keras.Input((shape.dims[1], shape.dims[2], 3)); | |
@@ -31,7 +31,7 @@ public Action<int, int> InputLayer | |||
| 31 | 31 | public Action<int, int> Prediction | |
| 32 | 32 | => (epoch, iterate) => | |
| 33 | 33 | { | |
| 34 | - TensorShape shape = (32, 256, 256, 3); // 48M | ||
| 34 | + Shape shape = (32, 256, 256, 3); // 48M | ||
| 35 | 35 | var images = np.arange(shape.size).astype(np.float32).reshape(shape.dims); | |
| 36 | 36 | ||
| 37 | 37 | var inputs = keras.Input((shape.dims[1], shape.dims[2], 3)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,7 @@ public Tensor boolean_mask<T1, T2>(T1 tensor, T2 mask, string name = "boolean_ma | |||
| 65 | 65 | /// <param name="shape"></param> | |
| 66 | 66 | /// <param name="name"></param> | |
| 67 | 67 | /// <returns></returns> | |
| 68 | - public Tensor broadcast_to(Tensor input, TensorShape shape, string name = null) | ||
| 68 | + public Tensor broadcast_to(Tensor input, Shape shape, string name = null) | ||
| 69 | 69 | => gen_array_ops.broadcast_to(input, shape, name: name); | |
| 70 | 70 | ||
| 71 | 71 | public Tensor check_numerics(Tensor tensor, string message, string name = null) | |
@@ -85,7 +85,7 @@ public Tensor concat(IEnumerable<Tensor> values, int axis, string name = "concat | |||
| 85 | 85 | return tf_with(ops.name_scope(name), scope => | |
| 86 | 86 | { | |
| 87 | 87 | var tensor = ops.convert_to_tensor(axis, name: "concat_dim", dtype: dtypes.int32); | |
| 88 | - Debug.Assert(tensor.TensorShape.ndim == 0); | ||
| 88 | + Debug.Assert(tensor.shape.ndim == 0); | ||
| 89 | 89 | return identity(values.First(), name: scope); | |
| 90 | 90 | }); | |
| 91 | 91 | } | |
@@ -152,7 +152,7 @@ public Tensor where<Tx, Ty>(Tensor condition, Tx x, Ty y, string name = null) | |||
| 152 | 152 | /// <param name="name"></param> | |
| 153 | 153 | /// <param name="conjugate"></param> | |
| 154 | 154 | /// <returns></returns> | |
| 155 | - public Tensor transpose<T1>(T1 a, TensorShape perm = null, string name = "transpose", bool conjugate = false) | ||
| 155 | + public Tensor transpose<T1>(T1 a, Shape perm = null, string name = "transpose", bool conjugate = false) | ||
| 156 | 156 | => array_ops.transpose(a, perm, name, conjugate); | |
| 157 | 157 | ||
| 158 | 158 | /// <summary> | |
@@ -246,7 +246,7 @@ public Tensor pad(Tensor tensor, Tensor paddings, string mode = "CONSTANT", stri | |||
| 246 | 246 | /// <typeparam name="T"></typeparam> | |
| 247 | 247 | /// <param name="input">A `Tensor`. The default value to produce when output is not fed.</param> | |
| 248 | 248 | /// <param name="shape"> | |
| 249 | - /// A `tf.TensorShape` or list of `int`s. The (possibly partial) shape of | ||
| 249 | + /// A `tf.Shape` or list of `int`s. The (possibly partial) shape of | ||
| 250 | 250 | /// the tensor. | |
| 251 | 251 | /// </param> | |
| 252 | 252 | /// <param name="name">A name for the operation (optional).</param> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ public void disable_eager_execution() | |||
| 25 | 25 | => tf.Context.graph_mode(); | |
| 26 | 26 | ||
| 27 | 27 | public IVariableV1 get_variable(string name, | |
| 28 | - TensorShape shape = null, | ||
| 28 | + Shape shape = null, | ||
| 29 | 29 | TF_DataType dtype = TF_DataType.DtInvalid, | |
| 30 | 30 | object initializer = null, // IInitializer or Tensor | |
| 31 | 31 | bool? trainable = null, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ public Tensor resize_images(Tensor images, Tensor size, string method = ResizeMe | |||
| 58 | 58 | string name = null) | |
| 59 | 59 | => image_ops_impl.resize_images(images, size, method, preserve_aspect_ratio, antialias, name); | |
| 60 | 60 | ||
| 61 | - public Tensor resize_images_v2(Tensor images, TensorShape size, string method = ResizeMethod.BILINEAR, bool preserve_aspect_ratio = false, bool antialias = false, | ||
| 61 | + public Tensor resize_images_v2(Tensor images, Shape size, string method = ResizeMethod.BILINEAR, bool preserve_aspect_ratio = false, bool antialias = false, | ||
| 62 | 62 | string name = null) | |
| 63 | 63 | => image_ops_impl.resize_images_v2(images, size, method, preserve_aspect_ratio, antialias, name); | |
| 64 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,7 +96,7 @@ public IInitializer random_normal_initializer(float mean = 0.0f, | |||
| 96 | 96 | seed: seed, | |
| 97 | 97 | dtype: dtype); | |
| 98 | 98 | ||
| 99 | - public IInitializer zeros_initializer(TensorShape shape = null, | ||
| 99 | + public IInitializer zeros_initializer(Shape shape = null, | ||
| 100 | 100 | TF_DataType dtype = TF_DataType.TF_FLOAT) => new Zeros(shape: shape, | |
| 101 | 101 | dtype: dtype); | |
| 102 | 102 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ public class LinalgApi | |||
| 27 | 27 | ||
| 28 | 28 | public Tensor eye(int num_rows, | |
| 29 | 29 | int num_columns = -1, | |
| 30 | - TensorShape batch_shape = null, | ||
| 30 | + Shape batch_shape = null, | ||
| 31 | 31 | TF_DataType dtype = TF_DataType.TF_DOUBLE, | |
| 32 | 32 | string name = null) | |
| 33 | 33 | => ops.eye(num_rows, num_columns: num_columns, batch_shape: batch_shape, dtype: dtype, name: name); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ public Tensor bincount(Tensor arr, Tensor weights = null, | |||
| 50 | 50 | Tensor maxlength = null, | |
| 51 | 51 | TF_DataType dtype = TF_DataType.TF_INT32, | |
| 52 | 52 | string name = null, | |
| 53 | - TensorShape axis = null, | ||
| 53 | + Shape axis = null, | ||
| 54 | 54 | bool binary_output = false) | |
| 55 | 55 | => math_ops.bincount(arr, weights: weights, minlength: minlength, maxlength: maxlength, | |
| 56 | 56 | dtype: dtype, name: name, axis: axis, binary_output: binary_output); | |
@@ -327,7 +327,7 @@ public Tensor log(Tensor x, string name = null) | |||
| 327 | 327 | => gen_math_ops.log(x, name); | |
| 328 | 328 | ||
| 329 | 329 | public Tensor equal(Tensor x, Tensor y, string name = null) | |
| 330 | - => gen_math_ops.equal(x, y, name); | ||
| 330 | + => gen_math_ops.equal(x, y, name: name); | ||
| 331 | 331 | ||
| 332 | 332 | /// <summary> | |
| 333 | 333 | /// Computes arctangent of `y/x` element-wise, respecting signs of the arguments. | |
@@ -453,7 +453,7 @@ public Tensor floordiv(Tensor x, Tensor y, string name = null) | |||
| 453 | 453 | public static Tensor truediv(Tensor x, Tensor y, string name = null) | |
| 454 | 454 | => math_ops.truediv(x, y, name: name); | |
| 455 | 455 | ||
| 456 | - public Tensor range(object start, object limit = null, object delta = null, TF_DataType dtype = TF_DataType.DtInvalid, string name = "range") | ||
| 456 | + public Tensor range(object start, object limit = null, object delta = null, TF_DataType? dtype = null, string name = "range") | ||
| 457 | 457 | => math_ops.range(start, limit: limit, delta: delta, dtype: dtype, name: name); | |
| 458 | 458 | ||
| 459 | 459 | public Tensor real(Tensor input, string name = null) | |
@@ -522,7 +522,7 @@ public Tensor reduce_sum(Tensor input, int? axis = null, int? reduction_indices | |||
| 522 | 522 | return math_ops.reduce_sum(input, keepdims: keepdims, name: name); | |
| 523 | 523 | } | |
| 524 | 524 | ||
| 525 | - public Tensor reduce_sum(Tensor input, TensorShape axis, int? reduction_indices = null, | ||
| 525 | + public Tensor reduce_sum(Tensor input, Shape axis, int? reduction_indices = null, | ||
| 526 | 526 | bool keepdims = false, string name = null) | |
| 527 | 527 | => math_ops.reduce_sum(input, axis, keepdims: keepdims, name: name); | |
| 528 | 528 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ public partial class tensorflow | |||
| 32 | 32 | /// <returns></returns> | |
| 33 | 33 | public PaddingFIFOQueue PaddingFIFOQueue(int capacity, | |
| 34 | 34 | TF_DataType[] dtypes, | |
| 35 | - TensorShape[] shapes, | ||
| 35 | + Shape[] shapes, | ||
| 36 | 36 | string[] names = null, | |
| 37 | 37 | string shared_name = null, | |
| 38 | 38 | string name = "padding_fifo_queue") | |
@@ -45,7 +45,7 @@ public PaddingFIFOQueue PaddingFIFOQueue(int capacity, | |||
| 45 | 45 | ||
| 46 | 46 | public PaddingFIFOQueue PaddingFIFOQueue(int capacity, | |
| 47 | 47 | TF_DataType dtype, | |
| 48 | - TensorShape shape, | ||
| 48 | + Shape shape, | ||
| 49 | 49 | string shared_name = null, | |
| 50 | 50 | string name = "padding_fifo_queue") | |
| 51 | 51 | => new PaddingFIFOQueue(capacity, | |
@@ -66,7 +66,7 @@ public PaddingFIFOQueue PaddingFIFOQueue(int capacity, | |||
| 66 | 66 | /// <returns></returns> | |
| 67 | 67 | public FIFOQueue FIFOQueue(int capacity, | |
| 68 | 68 | TF_DataType[] dtypes, | |
| 69 | - TensorShape[] shapes = null, | ||
| 69 | + Shape[] shapes = null, | ||
| 70 | 70 | string[] names = null, | |
| 71 | 71 | string shared_name = null, | |
| 72 | 72 | string name = "fifo_queue") | |
@@ -79,12 +79,12 @@ public FIFOQueue FIFOQueue(int capacity, | |||
| 79 | 79 | ||
| 80 | 80 | public FIFOQueue FIFOQueue(int capacity, | |
| 81 | 81 | TF_DataType dtype, | |
| 82 | - TensorShape shape = null, | ||
| 82 | + Shape shape = null, | ||
| 83 | 83 | string shared_name = null, | |
| 84 | 84 | string name = "fifo_queue") | |
| 85 | 85 | => new FIFOQueue(capacity, | |
| 86 | 86 | new[] { dtype }, | |
| 87 | - new[] { shape ?? new TensorShape() }, | ||
| 87 | + new[] { shape ?? Shape.Null }, | ||
| 88 | 88 | shared_name: shared_name, | |
| 89 | 89 | name: name); | |
| 90 | 90 | ||
@@ -99,26 +99,26 @@ public FIFOQueue FIFOQueue(int capacity, | |||
| 99 | 99 | /// <returns></returns> | |
| 100 | 100 | public PriorityQueue PriorityQueue(int capacity, | |
| 101 | 101 | TF_DataType dtype, | |
| 102 | - TensorShape shape = null, | ||
| 102 | + Shape shape = null, | ||
| 103 | 103 | string shared_name = null, | |
| 104 | 104 | string name = "priority_queue") | |
| 105 | 105 | => new PriorityQueue(capacity, | |
| 106 | 106 | new[] { dtype }, | |
| 107 | - new[] { shape ?? new TensorShape() }, | ||
| 107 | + new[] { shape ?? Shape.Null }, | ||
| 108 | 108 | shared_name: shared_name, | |
| 109 | 109 | name: name); | |
| 110 | 110 | ||
| 111 | 111 | public RandomShuffleQueue RandomShuffleQueue(int capacity, | |
| 112 | 112 | int min_after_dequeue, | |
| 113 | 113 | TF_DataType dtype, | |
| 114 | - TensorShape shape = null, | ||
| 114 | + Shape shape = null, | ||
| 115 | 115 | int? seed = null, | |
| 116 | 116 | string shared_name = null, | |
| 117 | 117 | string name = "random_shuffle_queue") | |
| 118 | 118 | => new RandomShuffleQueue(capacity, | |
| 119 | 119 | min_after_dequeue: min_after_dequeue, | |
| 120 | 120 | new[] { dtype }, | |
| 121 | - new[] { shape ?? new TensorShape() }, | ||
| 121 | + new[] { shape ?? Shape.Null }, | ||
| 122 | 122 | seed: seed, | |
| 123 | 123 | shared_name: shared_name, | |
| 124 | 124 | name: name); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments