|
64 | 64 | resize_nearest_neighbor = tf.compat.v1.image.resize_nearest_neighbor
|
65 | 65 | quantize_and_dequantize = tf.quantization.quantize_and_dequantize
|
66 | 66 | resize_bilinear = tf.compat.v1.image.resize_bilinear
|
| 67 | + resize_bilinear_v2 = tf.compat.v2.image.resize |
67 | 68 | is_nan = tf.math.is_nan
|
68 | 69 | is_inf = tf.math.is_inf
|
69 | 70 | floormod = tf.math.floormod
|
|
81 | 82 | quantize_and_dequantize = tf.compat.v1.quantization.quantize_and_dequantize
|
82 | 83 | resize_nearest_neighbor = tf.compat.v1.image.resize_nearest_neighbor
|
83 | 84 | resize_bilinear = tf.compat.v1.image.resize_bilinear
|
| 85 | + resize_bilinear_v2 = tf.compat.v2.image.resize |
84 | 86 | is_nan = tf.math.is_nan
|
85 | 87 | is_inf = tf.math.is_inf
|
86 | 88 | floormod = tf.floormod
|
@@ -1993,6 +1995,17 @@ def func(x, x_new_size_):
|
1993 | 1995 | return tf.identity(x_, name=_TFOUTPUT)
|
1994 | 1996 | self._run_test_case(func, [_OUTPUT], {_INPUT: x_val, _INPUT1: x_new_size})
|
1995 | 1997 |
|
| 1998 | + @check_tf_min_version("1.14") |
| 1999 | + @check_opset_min_version(11, "resize_bilinear_v2") |
| 2000 | + def test_resize_bilinear_v2_with_non_const(self): |
| 2001 | + x_shape = [3, 10, 8, 5] |
| 2002 | + x_val = np.arange(1, 1 + np.prod(x_shape), dtype=np.float32).reshape(x_shape) |
| 2003 | + x_new_size = np.array([20, 16]).astype(np.int32) |
| 2004 | + def func(x, x_new_size_): |
| 2005 | + x_ = resize_bilinear_v2(x, x_new_size_) |
| 2006 | + return tf.identity(x_, name=_TFOUTPUT) |
| 2007 | + self._run_test_case(func, [_OUTPUT], {_INPUT: x_val, _INPUT1: x_new_size}) |
| 2008 | + |
1996 | 2009 | @check_opset_min_version(10, "resize scale can less than 1")
|
1997 | 2010 | def test_resize_nearest_neighbor2(self):
|
1998 | 2011 | x_shape = [1, 300, 20, 2]
|
|
0 commit comments