Halide::BoundaryConditions::repeat_edge: How to repeat left, bottom, right, and top elemets of Buffer instead of only Bottom and right? #8208
-
Thanks for the wonderful library! Suppose I have the following buffer:
and the following algorithm, with a output that is of size (5,5) (two more rows and cols):
That generates the following buffer:
It seems that the right and bottom boundary are extended by two columns (rows). I would have expected to repeat the top and bottom rows and left and right columns. For example, the first row of the new buffer would be:
I understand that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
repeat_edge will pad on all sides. However, unlike ReplicationPad, repeat_edge also preserves the coordinate system in that f(x, y) before = f(x, y) after if (x, y) is in-bounds. So (0, 0) before is still (0, 0) after, and I think that might be what's tripping you up. To match ReplicationPad, try adding a translation:
|
Beta Was this translation helpful? Give feedback.
repeat_edge will pad on all sides. However, unlike ReplicationPad, repeat_edge also preserves the coordinate system in that f(x, y) before = f(x, y) after if (x, y) is in-bounds. So (0, 0) before is still (0, 0) after, and I think that might be what's tripping you up. To match ReplicationPad, try adding a translation: