| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c1b6731 commit 1c8f0a2
55 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,7 +112,7 @@ public Action<int, int> Conv2DWithTensor | |||
| 112 | 112 | var strides = new[] { 1, 1, 1, 1 }; | |
| 113 | 113 | var dilations = new[] { 1, 1, 1, 1 }; | |
| 114 | 114 | ||
| 115 | - var results = tf.Runner.TFE_FastPathExecute(new FastPathOpExecInfo("Conv2D", null, input, filter) | ||
| 115 | + var results = tf.Runner.TFE_FastPathExecute(new FastPathOpExecInfo(tf.Context, "Conv2D", null, input, filter) | ||
| 116 | 116 | { | |
| 117 | 117 | attrs = ConvertToDict(new | |
| 118 | 118 | { | |
@@ -134,7 +134,7 @@ public Action<int, int> Conv2DWithVariable | |||
| 134 | 134 | var strides = new[] { 1, 1, 1, 1 }; | |
| 135 | 135 | var dilations = new[] { 1, 1, 1, 1 }; | |
| 136 | 136 | ||
| 137 | - var results = tf.Runner.TFE_FastPathExecute(new FastPathOpExecInfo("Conv2D", null, input, filter) | ||
| 137 | + var results = tf.Runner.TFE_FastPathExecute(new FastPathOpExecInfo(tf.Context, "Conv2D", null, input, filter) | ||
| 138 | 138 | { | |
| 139 | 139 | attrs = ConvertToDict(new | |
| 140 | 140 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,8 @@ public partial class tensorflow | |||
| 44 | 44 | /// <param name="name"></param> | |
| 45 | 45 | /// <returns></returns> | |
| 46 | 46 | public Tensor batch_to_space_nd<T>(T input, int[] block_shape, int[,] crops, string name = null) | |
| 47 | - => gen_array_ops.batch_to_space_nd(input, block_shape, crops, name: name); | ||
| 47 | + => gen_array_ops.batch_to_space_nd(ops.convert_to_tensor(input), ops.convert_to_tensor(block_shape), | ||
| 48 | + ops.convert_to_tensor(crops), name: name); | ||
| 48 | 49 | ||
| 49 | 50 | /// <summary> | |
| 50 | 51 | /// Apply boolean mask to tensor. | |
@@ -91,7 +92,7 @@ public Tensor concat(IEnumerable<Tensor> values, int axis, string name = "concat | |||
| 91 | 92 | }); | |
| 92 | 93 | } | |
| 93 | 94 | ||
| 94 | - return gen_array_ops.concat_v2(values.ToArray(), axis, name: name); | ||
| 95 | + return gen_array_ops.concat_v2(values.ToArray(), ops.convert_to_tensor(axis), name: name); | ||
| 95 | 96 | } | |
| 96 | 97 | ||
| 97 | 98 | /// <summary> | |
@@ -115,7 +116,7 @@ public Tensor expand_dims(Tensor input, int axis = -1, string name = null) | |||
| 115 | 116 | /// <param name="name"></param> | |
| 116 | 117 | /// <returns></returns> | |
| 117 | 118 | public Tensor fill<T>(Tensor dims, T value, string name = null) | |
| 118 | - => gen_array_ops.fill(dims, value, name: name); | ||
| 119 | + => gen_array_ops.fill(dims, ops.convert_to_tensor(value), name: name); | ||
| 119 | 120 | ||
| 120 | 121 | public Tensor fill<T>(Shape dims, T value, string name = null) | |
| 121 | 122 | => array_ops.fill(dims, value, name: name); | |
@@ -138,7 +139,7 @@ public Tensor identity(Tensor input, string name = null) | |||
| 138 | 139 | /// <param name="axis"></param> | |
| 139 | 140 | /// <returns></returns> | |
| 140 | 141 | public Tensor gather(Tensor @params, Tensor indices, string name = null, int axis = 0) | |
| 141 | - => array_ops.gather(@params, indices, name: name, axis: axis); | ||
| 142 | + => array_ops.gather(@params, indices, name: name, axis: ops.convert_to_tensor(axis)); | ||
| 142 | 143 | ||
| 143 | 144 | /// <summary> | |
| 144 | 145 | /// Return the elements, either from `x` or `y`, depending on the `condition`. | |
@@ -166,7 +167,7 @@ public Tensor transpose<T1>(T1 a, Axis perm = null, string name = "transpose", b | |||
| 166 | 167 | /// <param name="name"></param> | |
| 167 | 168 | /// <returns></returns> | |
| 168 | 169 | public Tensor reverse(Tensor tensor, int[] axis, string name = null) | |
| 169 | - => gen_array_ops.reverse(tensor, axis, name: name); | ||
| 170 | + => gen_array_ops.reverse(tensor, ops.convert_to_tensor(axis), name: name); | ||
| 170 | 171 | ||
| 171 | 172 | public Tensor reverse(Tensor tensor, Tensor axis, string name = null) | |
| 172 | 173 | => gen_array_ops.reverse(tensor, axis, name: name); | |
@@ -189,7 +190,8 @@ public Tensor rank(Tensor input, string name = null) | |||
| 189 | 190 | /// <param name="name">A name for the operation (optional).</param> | |
| 190 | 191 | /// <returns>A `Tensor` the same type as `input`.</returns> | |
| 191 | 192 | public Tensor slice<Tb, Ts>(Tensor input, Tb[] begin, Ts[] size, string name = null) | |
| 192 | - => array_ops.slice(input, begin, size, name: name); | ||
| 193 | + => array_ops.slice(input, begin.Select(x => ops.convert_to_tensor(x)).ToArray(), | ||
| 194 | + size.Select(x => ops.convert_to_tensor(x)).ToArray(), name: name); | ||
| 193 | 195 | ||
| 194 | 196 | public Tensor squeeze(Tensor input, int axis, string name = null, int squeeze_dims = -1) | |
| 195 | 197 | => array_ops.squeeze(input, new[] { axis }, name); | |
@@ -255,7 +257,7 @@ public Tensor pad(Tensor tensor, Tensor paddings, string mode = "CONSTANT", stri | |||
| 255 | 257 | /// <param name="name">A name for the operation (optional).</param> | |
| 256 | 258 | /// <returns>A `Tensor`. Has the same type as `input`.</returns> | |
| 257 | 259 | public Tensor placeholder_with_default<T>(T input, int[] shape, string name = null) | |
| 258 | - => gen_array_ops.placeholder_with_default(input, shape, name: name); | ||
| 260 | + => gen_array_ops.placeholder_with_default(ops.convert_to_tensor(input), shape, name: name); | ||
| 259 | 261 | ||
| 260 | 262 | /// <summary> | |
| 261 | 263 | /// Returns the shape of a tensor. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -130,7 +130,7 @@ public Tensor add(Tensor a, Tensor b, string name = null) | |||
| 130 | 130 | => gen_math_ops.add(a, b, name: name); | |
| 131 | 131 | ||
| 132 | 132 | public Tensor add<Tx, Ty>(Tx a, Ty b, string name = null) | |
| 133 | - => gen_math_ops.add(a, b, name: name); | ||
| 133 | + => gen_math_ops.add(ops.convert_to_tensor(a), ops.convert_to_tensor(b), name: name); | ||
| 134 | 134 | ||
| 135 | 135 | /// <summary> | |
| 136 | 136 | /// Adds all input tensors element-wise. | |
@@ -151,10 +151,10 @@ public Tensor atan(Tensor x, string name = null) | |||
| 151 | 151 | => gen_math_ops.atan(x, name); | |
| 152 | 152 | ||
| 153 | 153 | public Tensor arg_max(Tensor input, int dimension, TF_DataType output_type = TF_DataType.TF_INT64, string name = null) | |
| 154 | - => gen_math_ops.arg_max(input, dimension, output_type: output_type, name: name); | ||
| 154 | + => gen_math_ops.arg_max(input, ops.convert_to_tensor(dimension), output_type: output_type, name: name); | ||
| 155 | 155 | ||
| 156 | 156 | public Tensor arg_min(Tensor input, int dimension, TF_DataType output_type = TF_DataType.TF_INT64, string name = null) | |
| 157 | - => gen_math_ops.arg_min(input, dimension, output_type: output_type, name: name); | ||
| 157 | + => gen_math_ops.arg_min(input, ops.convert_to_tensor(dimension), output_type: output_type, name: name); | ||
| 158 | 158 | ||
| 159 | 159 | public Tensor is_finite(Tensor input, string name = null) | |
| 160 | 160 | => gen_math_ops.is_finite(input, name); | |
@@ -199,7 +199,7 @@ public Tensor cos(Tensor x, string name = null) | |||
| 199 | 199 | => gen_math_ops.cos(x, name); | |
| 200 | 200 | ||
| 201 | 201 | public Tensor cos(float x, string name = null) | |
| 202 | - => gen_math_ops.cos(x, name); | ||
| 202 | + => gen_math_ops.cos(ops.convert_to_tensor(x), name); | ||
| 203 | 203 | ||
| 204 | 204 | /// <summary> | |
| 205 | 205 | /// Computes hyperbolic cosine of x element-wise. | |
@@ -235,7 +235,7 @@ public Tensor floor(Tensor x, string name = null) | |||
| 235 | 235 | /// <param name="name"></param> | |
| 236 | 236 | /// <returns></returns> | |
| 237 | 237 | public Tensor greater<Tx, Ty>(Tx x, Ty y, string name = null) | |
| 238 | - => gen_math_ops.greater(x, y, name); | ||
| 238 | + => gen_math_ops.greater(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name); | ||
| 239 | 239 | ||
| 240 | 240 | /// <summary> | |
| 241 | 241 | /// Returns the truth value of (x >= y) element-wise. | |
@@ -247,7 +247,7 @@ public Tensor greater<Tx, Ty>(Tx x, Ty y, string name = null) | |||
| 247 | 247 | /// <param name="name"></param> | |
| 248 | 248 | /// <returns></returns> | |
| 249 | 249 | public Tensor greater_equal<Tx, Ty>(Tx x, Ty y, string name = null) | |
| 250 | - => gen_math_ops.greater_equal(x, y, name); | ||
| 250 | + => gen_math_ops.greater_equal(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name); | ||
| 251 | 251 | ||
| 252 | 252 | /// <summary> | |
| 253 | 253 | /// Returns the truth value of (x < y) element-wise. | |
@@ -259,7 +259,7 @@ public Tensor greater_equal<Tx, Ty>(Tx x, Ty y, string name = null) | |||
| 259 | 259 | /// <param name="name"></param> | |
| 260 | 260 | /// <returns></returns> | |
| 261 | 261 | public Tensor less<Tx, Ty>(Tx x, Ty y, string name = null) | |
| 262 | - => gen_math_ops.less(x, y, name); | ||
| 262 | + => gen_math_ops.less(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name); | ||
| 263 | 263 | ||
| 264 | 264 | /// <summary> | |
| 265 | 265 | /// Computes the log of the absolute value of `Gamma(x)` element-wise. | |
@@ -280,7 +280,7 @@ public Tensor lgamma(Tensor x, string name = null) | |||
| 280 | 280 | /// <param name="name"></param> | |
| 281 | 281 | /// <returns></returns> | |
| 282 | 282 | public Tensor less_equal<Tx, Ty>(Tx x, Ty y, string name = null) | |
| 283 | - => gen_math_ops.less_equal(x, y, name); | ||
| 283 | + => gen_math_ops.less_equal(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name); | ||
| 284 | 284 | ||
| 285 | 285 | /// <summary> | |
| 286 | 286 | /// Computes natural logarithm of (1 + x) element-wise. | |
@@ -292,7 +292,7 @@ public Tensor log1p(Tensor x, string name = null) | |||
| 292 | 292 | => gen_math_ops.log1p(x, name); | |
| 293 | 293 | ||
| 294 | 294 | public Tensor logical_and<T>(T x, T y, string name = null) | |
| 295 | - => gen_math_ops.logical_and(x, y, name); | ||
| 295 | + => gen_math_ops.logical_and(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name); | ||
| 296 | 296 | ||
| 297 | 297 | public Tensor logical_not(Tensor x, string name = null) | |
| 298 | 298 | => gen_math_ops.logical_not(x, name); | |
@@ -301,7 +301,10 @@ public Tensor logical_or(Tensor x, Tensor y, string name = null) | |||
| 301 | 301 | => gen_math_ops.logical_or(x, y, name); | |
| 302 | 302 | ||
| 303 | 303 | public Tensor logical_xor(Tensor x, Tensor y, string name = "LogicalXor") | |
| 304 | - => gen_math_ops.logical_xor(x, y, name); | ||
| 304 | + { | ||
| 305 | + return gen_math_ops.logical_and(gen_math_ops.logical_or(x, y), | ||
| 306 | + gen_math_ops.logical_not(gen_math_ops.logical_and(x, y)), name); | ||
| 307 | + } | ||
| 305 | 308 | ||
| 306 | 309 | /// <summary> | |
| 307 | 310 | /// Clips tensor values to a specified min and max. | |
@@ -312,7 +315,7 @@ public Tensor logical_xor(Tensor x, Tensor y, string name = "LogicalXor") | |||
| 312 | 315 | /// <param name="name"></param> | |
| 313 | 316 | /// <returns></returns> | |
| 314 | 317 | public Tensor _clip_by_value(Tensor t, Tensor clip_value_min, Tensor clip_value_max, string name = null) | |
| 315 | - => gen_math_ops._clip_by_value(t, clip_value_min, clip_value_max); | ||
| 318 | + => gen_math_ops.clip_by_value(t, clip_value_min, clip_value_max); | ||
| 316 | 319 | ||
| 317 | 320 | /// <summary> | |
| 318 | 321 | /// Clips tensor values to a specified min and max. | |
@@ -345,7 +348,7 @@ public Tensor clip_by_value<T1, T2>(Tensor t, T1 clip_value_min, T2 clip_value_m | |||
| 345 | 348 | => clip_ops.clip_by_value(t, clip_value_min, clip_value_max, name); | |
| 346 | 349 | ||
| 347 | 350 | public Tensor sub<Tx, Ty>(Tx a, Ty b, string name = null) | |
| 348 | - => gen_math_ops.sub(a, b, name: name); | ||
| 351 | + => gen_math_ops.sub(ops.convert_to_tensor(a), ops.convert_to_tensor(b), name: name); | ||
| 349 | 352 | ||
| 350 | 353 | public Tensor divide(Tensor a, Tensor b) | |
| 351 | 354 | => a / b; | |
@@ -396,7 +399,7 @@ public Tensor atan2(Tensor y, Tensor x, string name = null) | |||
| 396 | 399 | /// <param name="name"></param> | |
| 397 | 400 | /// <returns></returns> | |
| 398 | 401 | public Tensor max<Tx, Ty>(Tx input, Ty axis, bool keep_dims = false, string name = null) | |
| 399 | - => gen_math_ops._max(input, axis, keep_dims: keep_dims, name: name); | ||
| 402 | + => gen_math_ops.max(ops.convert_to_tensor(input), ops.convert_to_tensor(axis), keep_dims: keep_dims, name: name); | ||
| 400 | 403 | ||
| 401 | 404 | /// <summary> | |
| 402 | 405 | /// Computes the minimum of elements across dimensions of a tensor. | |
@@ -409,7 +412,7 @@ public Tensor max<Tx, Ty>(Tx input, Ty axis, bool keep_dims = false, string name | |||
| 409 | 412 | /// <param name="name"></param> | |
| 410 | 413 | /// <returns></returns> | |
| 411 | 414 | public Tensor min<Tx, Ty>(Tx input, Ty axis, bool keep_dims = false, string name = null) | |
| 412 | - => gen_math_ops._min(input, axis, keep_dims: keep_dims, name: name); | ||
| 415 | + => gen_math_ops.min(ops.convert_to_tensor(input), ops.convert_to_tensor(axis), keep_dims: keep_dims, name: name); | ||
| 413 | 416 | ||
| 414 | 417 | /// <summary> | |
| 415 | 418 | /// Returns the max of x and y (i.e. x > y ? x : y) element-wise. | |
@@ -421,7 +424,7 @@ public Tensor min<Tx, Ty>(Tx input, Ty axis, bool keep_dims = false, string name | |||
| 421 | 424 | /// <param name="name"></param> | |
| 422 | 425 | /// <returns></returns> | |
| 423 | 426 | public Tensor maximum<T1, T2>(T1 x, T2 y, string name = null) | |
| 424 | - => gen_math_ops.maximum(x, y, name: name); | ||
| 427 | + => gen_math_ops.maximum(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name: name); | ||
| 425 | 428 | ||
| 426 | 429 | /// <summary> | |
| 427 | 430 | /// Returns the min of x and y (i.e. x < y ? x : y) element-wise. | |
@@ -433,7 +436,7 @@ public Tensor maximum<T1, T2>(T1 x, T2 y, string name = null) | |||
| 433 | 436 | /// <param name="name"></param> | |
| 434 | 437 | /// <returns></returns> | |
| 435 | 438 | public Tensor minimum<T1, T2>(T1 x, T2 y, string name = null) | |
| 436 | - => gen_math_ops.minimum(x, y, name: name); | ||
| 439 | + => gen_math_ops.minimum(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name: name); | ||
| 437 | 440 | ||
| 438 | 441 | public Tensor multiply(Tensor x, Tensor y, string name = null) | |
| 439 | 442 | => gen_math_ops.mul(x, y, name: name); | |
@@ -448,7 +451,7 @@ public Tensor multiply(Tensor x, Tensor y, string name = null) | |||
| 448 | 451 | /// <param name="name"></param> | |
| 449 | 452 | /// <returns></returns> | |
| 450 | 453 | public Tensor multiply<Tx, Ty>(Tx x, Ty y, string name = null) | |
| 451 | - => gen_math_ops.mul(x, y, name: name); | ||
| 454 | + => gen_math_ops.mul(ops.convert_to_tensor(x), ops.convert_to_tensor(y), name: name); | ||
| 452 | 455 | ||
| 453 | 456 | public Tensor negative(Tensor x, string name = null) | |
| 454 | 457 | => gen_math_ops.neg(x, name); | |
@@ -577,7 +580,7 @@ public Tensor sigmoid<T>(T x, string name = null) | |||
| 577 | 580 | => math_ops.sigmoid(x, name: name); | |
| 578 | 581 | ||
| 579 | 582 | public Tensor sum(Tensor input, int axis, bool keep_dims = false, string name = null) | |
| 580 | - => gen_math_ops._sum(input, axis, keep_dims: keep_dims, name: name); | ||
| 583 | + => gen_math_ops.sum(input, ops.convert_to_tensor(axis), keep_dims: keep_dims, name: name); | ||
| 581 | 584 | ||
| 582 | 585 | public Tensor reduce_mean(Tensor input_tensor, Axis? axis = null, bool keepdims = false, string name = null, int? reduction_indices = null) | |
| 583 | 586 | => math_ops.reduce_mean(input_tensor, axis: axis, keepdims: keepdims, name: name, reduction_indices: reduction_indices); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,21 +29,8 @@ public class nn_internal | |||
| 29 | 29 | public Tensor conv2d(Tensor input, Tensor filter, int[] strides, string padding, bool use_cudnn_on_gpu = true, | |
| 30 | 30 | string data_format = "NHWC", int[] dilations = null, string name = null) | |
| 31 | 31 | { | |
| 32 | - var parameters = new Conv2dParams | ||
| 33 | - { | ||
| 34 | - Input = input, | ||
| 35 | - Filter = filter, | ||
| 36 | - Strides = strides, | ||
| 37 | - Padding = padding, | ||
| 38 | - UseCudnnOnGpu = use_cudnn_on_gpu, | ||
| 39 | - DataFormat = data_format, | ||
| 40 | - Name = name | ||
| 41 | - }; | ||
| 42 | - | ||
| 43 | - if (dilations != null) | ||
| 44 | - parameters.Dilations = dilations; | ||
| 45 | - | ||
| 46 | - return gen_nn_ops.conv2d(parameters); | ||
| 32 | + return gen_nn_ops.conv2d(input, filter, strides, padding, use_cudnn_on_gpu, | ||
| 33 | + data_format: data_format, dilations: dilations, name: name); | ||
| 47 | 34 | } | |
| 48 | 35 | ||
| 49 | 36 | public Tensor[] ctc_greedy_decoder(Tensor inputs, Tensor sequence_length, bool merge_repeated = true, string name = null) | |
@@ -118,7 +105,7 @@ public Tensor embedding_lookup(Tensor @params, | |||
| 118 | 105 | ||
| 119 | 106 | public IActivation softmax() => new softmax(); | |
| 120 | 107 | public Tensor tanh(Tensor x, string name = null) | |
| 121 | - => gen_nn_ops.tanh(x, name); | ||
| 108 | + => gen_math_ops.tanh(x, name); | ||
| 122 | 109 | ||
| 123 | 110 | public Tensor relu(Tensor features, string name = null) | |
| 124 | 111 | => gen_nn_ops.relu(features, name); | |
@@ -146,14 +133,14 @@ public Tensor in_top_k(Tensor predictions, Tensor targets, int k, string name = | |||
| 146 | 133 | => nn_ops.in_top_k(predictions, targets, k, name); | |
| 147 | 134 | ||
| 148 | 135 | public Tensor[] top_k(Tensor input, int k = 1, bool sorted = true, string name = null) | |
| 149 | - => gen_nn_ops.top_kv2(input, k: k, sorted: sorted, name: name); | ||
| 136 | + => gen_nn_ops.top_kv2(input, k: ops.convert_to_tensor(k), sorted: sorted, name: name); | ||
| 150 | 137 | ||
| 151 | 138 | public Tensor bias_add(Tensor value, IVariableV1 bias, string data_format = null, string name = null) | |
| 152 | 139 | { | |
| 153 | 140 | return tf_with(ops.name_scope(name, "BiasAdd", new { value, bias }), scope => | |
| 154 | 141 | { | |
| 155 | 142 | name = scope; | |
| 156 | - return gen_nn_ops.bias_add(value, bias, data_format: data_format, name: name); | ||
| 143 | + return gen_nn_ops.bias_add(value, ops.convert_to_tensor(bias), data_format: data_format, name: name); | ||
| 157 | 144 | }); | |
| 158 | 145 | } | |
| 159 | 146 | ||
@@ -172,7 +159,7 @@ public Tensor l2_loss(Tensor t, string name = null) | |||
| 172 | 159 | /// <returns></returns> | |
| 173 | 160 | public Tensor lrn(Tensor input, int depth_radius = 5, int bias = 1, | |
| 174 | 161 | int alpha = 1, float beta = 0.5f, string name = null) | |
| 175 | - => gen_nn_ops.local_response_normalization(input, depth_radius: depth_radius, bias: bias, | ||
| 162 | + => gen_nn_ops.lrn(input, depth_radius: depth_radius, bias: bias, | ||
| 176 | 163 | alpha: alpha, beta: beta, name: name); | |
| 177 | 164 | ||
| 178 | 165 | public Tensor leaky_relu(Tensor features, float alpha = 0.2f, string name = null) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,6 @@ public Tensor reshape(Tensor tensor, | |||
| 31 | 31 | public Tensor reshape(Tensor tensor, | |
| 32 | 32 | object[] shape, | |
| 33 | 33 | string name = null) | |
| 34 | - => gen_array_ops.reshape(tensor, shape, name); | ||
| 34 | + => gen_array_ops.reshape(tensor, ops.convert_to_tensor(shape), name); | ||
| 35 | 35 | } | |
| 36 | 36 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,10 +46,10 @@ public Tensor strided_slice<T>(Tensor input, T[] begin, T[] end, T[] strides = n | |||
| 46 | 46 | int ellipsis_mask = 0, | |
| 47 | 47 | int new_axis_mask = 0, | |
| 48 | 48 | int shrink_axis_mask = 0, | |
| 49 | - string name = null) => gen_array_ops.strided_slice(input: input, | ||
| 50 | - begin: begin, | ||
| 51 | - end: end, | ||
| 52 | - strides: strides, | ||
| 49 | + string name = null) => array_ops.strided_slice(input, | ||
| 50 | + begin: ops.convert_to_tensor(begin), | ||
| 51 | + end: ops.convert_to_tensor(end), | ||
| 52 | + strides: ops.convert_to_tensor(strides), | ||
| 53 | 53 | begin_mask: begin_mask, | |
| 54 | 54 | end_mask: end_mask, | |
| 55 | 55 | ellipsis_mask: ellipsis_mask, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ public Tensor tile(Tensor input, Tensor multiples, string name = null) | |||
| 23 | 23 | => gen_array_ops.tile(input, multiples, name); | |
| 24 | 24 | ||
| 25 | 25 | public Tensor tile(Tensor input, object[] multiples, string name = null) | |
| 26 | - => gen_array_ops.tile(input, multiples, name); | ||
| 26 | + => gen_array_ops.tile(input, ops.convert_to_tensor(multiples), name); | ||
| 27 | 27 | ||
| 28 | 28 | public Tensor tile(Tensor input, Shape multiples, string name = null) | |
| 29 | 29 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,6 +57,21 @@ public partial class c_api | |||
| 57 | 57 | [DllImport(TensorFlowLibName)] | |
| 58 | 58 | public static extern int TF_OperationGetAttrValueProto(IntPtr oper, string attr_name, SafeBufferHandle output_attr_value, SafeStatusHandle status); | |
| 59 | 59 | ||
| 60 | + [DllImport(TensorFlowLibName)] | ||
| 61 | + public static extern void TF_OperationGetAttrType(IntPtr oper, string attr_name, IntPtr value, SafeStatusHandle status); | ||
| 62 | + | ||
| 63 | + [DllImport(TensorFlowLibName)] | ||
| 64 | + public static extern void TF_OperationGetAttrInt(IntPtr oper, string attr_name, IntPtr value, SafeStatusHandle status); | ||
| 65 | + | ||
| 66 | + [DllImport(TensorFlowLibName)] | ||
| 67 | + public static extern void TF_OperationGetAttrFloat(IntPtr oper, string attr_name, IntPtr value, SafeStatusHandle status); | ||
| 68 | + | ||
| 69 | + [DllImport(TensorFlowLibName)] | ||
| 70 | + public static extern void TF_OperationGetAttrBool(IntPtr oper, string attr_name, IntPtr value, SafeStatusHandle status); | ||
| 71 | + | ||
| 72 | + [DllImport(TensorFlowLibName)] | ||
| 73 | + public static extern void TF_OperationGetAttrShape(IntPtr oper, string attr_name, long[] value, int num_dims, SafeStatusHandle status); | ||
| 74 | + | ||
| 60 | 75 | [DllImport(TensorFlowLibName)] | |
| 61 | 76 | public static extern void TF_SetAttrBool(IntPtr desc, string attr_name, bool value); | |
| 62 | 77 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,7 +88,7 @@ private Tensor _initialize() | |||
| 88 | 88 | ||
| 89 | 89 | public Tensor op() | |
| 90 | 90 | { | |
| 91 | - var x = control_flow_ops.cond(gen_math_ops.equal(_num_remaining, 0), | ||
| 91 | + var x = control_flow_ops.cond(gen_math_ops.equal(_num_remaining, ops.convert_to_tensor(0)), | ||
| 92 | 92 | () => | |
| 93 | 93 | { | |
| 94 | 94 | return check_ops.assert_equal(_cluster_centers_initialized, true); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments