(y_coords, x_coords, name)
| 141 | # Then we gather. Finally, we reshape the output back. It's possible this |
| 142 | # code would be made simpler by using array_ops.gather_nd. |
| 143 | def gather(y_coords, x_coords, name): |
| 144 | with ops.name_scope('gather-' + name): |
| 145 | linear_coordinates = batch_offsets + y_coords * width + x_coords |
| 146 | gathered_values = array_ops.gather(flattened_grid, linear_coordinates) |
| 147 | return array_ops.reshape(gathered_values, |
| 148 | [batch_size, num_queries, channels]) |
| 149 | |
| 150 | # grab the pixel values in the 4 corners around each query point |
| 151 | top_left = gather(floors[0], floors[1], 'top_left') |
no test coverage detected