Skip to content

Commit 6dd15f7

Browse files
authored
Merge pull request #1143 from dogvane/master
fix flip_left_right run bug
2 parents b2fe5ca + f56811d commit 6dd15f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TensorFlowNET.Core/Operations/image_ops_impl.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ internal static Tensor _random_flip(Tensor image, int flip_index, int seed, stri
208208
}
209209

210210
public static Tensor flip_left_right(Tensor image)
211-
=> _flip(image, 1, "flip_left_right");
211+
=> _flip(image, 0, "flip_left_right");
212212

213213
public static Tensor flip_up_down(Tensor image)
214214
=> _flip(image, 1, "flip_up_down");
@@ -226,7 +226,7 @@ internal static Tensor _flip(Tensor image, int flip_index, string scope_name)
226226
}
227227
else if (shape.ndim == 4)
228228
{
229-
return gen_array_ops.reverse(image, ops.convert_to_tensor(new[] { flip_index + 1 }));
229+
return gen_array_ops.reverse_v2(image, ops.convert_to_tensor(new[] { (flip_index + 1) % 2 }));
230230
}
231231
else
232232
{

0 commit comments

Comments
 (0)