Skip to content

Commit

Permalink
Merge pull request #1143 from dogvane/master
Browse files Browse the repository at this point in the history
fix flip_left_right run bug
  • Loading branch information
Oceania2018 authored Jul 10, 2023
2 parents b2fe5ca + f56811d commit 6dd15f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TensorFlowNET.Core/Operations/image_ops_impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ internal static Tensor _random_flip(Tensor image, int flip_index, int seed, stri
}

public static Tensor flip_left_right(Tensor image)
=> _flip(image, 1, "flip_left_right");
=> _flip(image, 0, "flip_left_right");

public static Tensor flip_up_down(Tensor image)
=> _flip(image, 1, "flip_up_down");
Expand All @@ -226,7 +226,7 @@ internal static Tensor _flip(Tensor image, int flip_index, string scope_name)
}
else if (shape.ndim == 4)
{
return gen_array_ops.reverse(image, ops.convert_to_tensor(new[] { flip_index + 1 }));
return gen_array_ops.reverse_v2(image, ops.convert_to_tensor(new[] { (flip_index + 1) % 2 }));
}
else
{
Expand Down

0 comments on commit 6dd15f7

Please sign in to comment.