Skip to content

Commit d33927a

Browse files
hcurOceania2018
authored andcommitted
fix build
1 parent c019b44 commit d33927a

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

src/TensorFlowNET.Core/Operations/gen_image_ops.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ namespace Tensorflow
2121
{
2222
public class gen_image_ops
2323
{
24+
public static (Tensor, Tensor, Tensor, Tensor) combined_non_max_suppression(Tensor boxes, Tensor scores, Tensor max_output_size_per_class, Tensor max_total_size,
25+
Tensor iou_threshold, Tensor score_threshold, bool pad_per_class, bool clip_boxes)
26+
{
27+
throw new NotImplementedException("combined_non_max_suppression");
28+
}
29+
2430
public static Tensor convert_image_dtype(Tensor image, TF_DataType dtype, bool saturate = false, string name= null)
2531
{
2632
if (dtype == image.dtype)

src/TensorFlowNET.Core/Operations/gen_math_ops.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,17 +1086,17 @@ public static Tensor _min<Tx, Ty>(Tx input, Ty axis, bool keep_dims = false, str
10861086

10871087
public static Tensor pow<Tx, Ty>(Tx x, Ty y, string name = null)
10881088
{
1089-
if (tf.context.executing_eagerly())
1089+
if (tf.Context.executing_eagerly())
10901090
{
1091-
var results = tf.Runner.TFE_FastPathExecute(tf.context, tf.context.device_name,
1091+
var results = tf.Runner.TFE_FastPathExecute(tf.Context, tf.Context.DeviceName,
10921092
"Pow", name,
10931093
null,
10941094
x, y);
10951095

10961096
return results[0];
10971097
}
10981098

1099-
var _op = tf._op_def_lib._apply_op_helper("Pow", name, args: new { x, y });
1099+
var _op = tf.OpDefLib._apply_op_helper("Pow", name, args: new { x, y });
11001100

11011101
return _op.outputs[0];
11021102
}
@@ -1214,4 +1214,4 @@ public static Tensor zero_fraction(Tensor value, string name = null)
12141214
return _op.outputs[0];
12151215
}
12161216
}
1217-
}
1217+
}

src/TensorFlowNET.Core/Operations/gen_ops.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using System;
2+
using System.Linq;
23
using System.Collections.Generic;
34
using static Tensorflow.Binding;
45

@@ -9881,6 +9882,11 @@ public static Tensor encode_jpeg (Tensor image, string format = null, int? quali
98819882
return op.output;
98829883
}
98839884

9885+
public static Tensor encode_jpeg_variable_quality(Tensor image, Tensor quality)
9886+
{
9887+
throw new NotImplementedException("");
9888+
}
9889+
98849890
/// <summary>
98859891
/// PNG-encode an image.
98869892
/// </summary>
@@ -28061,6 +28067,11 @@ public static Operation save_v2 (Tensor prefix, Tensor tensor_names, Tensor shap
2806128067
return op;
2806228068
}
2806328069

28070+
public static Tensor scale_and_translate (Tensor images_t, Tensor new_size, Tensor[] scale, Tensor zeroes, string kernel_type, bool antialias)
28071+
{
28072+
throw new NotImplementedException("scale_and_translate");
28073+
}
28074+
2806428075
/// <summary>
2806528076
/// Outputs a <c>Summary</c> protocol buffer with scalar values.
2806628077
/// </summary>

src/TensorFlowNET.Core/Operations/image_ops_impl.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ object[] _get_dim(Tensor tensor, int idx) {
337337
object hd, bbox_h_start;
338338
if ((bool)h[1])
339339
{
340-
hd = math_ops.cast(h[0], dtypes.float64);
340+
hd = math_ops.cast((IVariableV1)h[0], dtypes.float64);
341341
bbox_h_start = math_ops.cast(((int)hd - (int)hd * central_fraction) / 2, dtypes.int32);
342342
} else
343343
{
@@ -348,7 +348,7 @@ object[] _get_dim(Tensor tensor, int idx) {
348348
object wd, bbox_w_start;
349349
if ((bool)w[1])
350350
{
351-
wd = math_ops.cast((RefVariable)w[0], dtypes.float64);
351+
wd = math_ops.cast((IVariableV1)w[0], dtypes.float64);
352352
bbox_w_start = math_ops.cast(((int)wd - (int)wd * central_fraction) / 2, dtypes.int32);
353353
} else
354354
{
@@ -1743,7 +1743,7 @@ public static Tensor decode_image(Tensor contents, int channels = 0, TF_DataType
17431743

17441744
public static Tensor crop_and_resize(Tensor image, Tensor boxes, Tensor box_ind, Tensor crop_size, string method, float extrapolation_value, string name)
17451745
{
1746-
var _op = tf._op_def_lib._apply_op_helper("CropAndResize", name: name, args: new
1746+
var _op = tf.OpDefLib._apply_op_helper("CropAndResize", name: name, args: new
17471747
{
17481748
image,
17491749
boxes,
@@ -1780,8 +1780,8 @@ public static (Tensor, Tensor, Tensor, Tensor) combined_non_max_suppression(Tens
17801780
Tensor score_threshold_tensor = ops.convert_to_tensor(
17811781
score_threshold, dtype: dtypes.float32, name: "score_threshold");
17821782
return gen_image_ops.combined_non_max_suppression(
1783-
boxes, scores, max_output_size_per_class, max_total_size, iou_threshold,
1784-
score_threshold, pad_per_class, clip_boxes);
1783+
boxes, scores, max_output_size_per_class, max_total_size, iou_threshold_tensor,
1784+
score_threshold_tensor, pad_per_class, clip_boxes);
17851785
});
17861786
}
17871787

0 commit comments

Comments
 (0)