MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / gather

Function gather

tensorflow/contrib/image/python/ops/dense_image_warp.py:143–148  ·  view source on GitHub ↗
(y_coords, x_coords, name)

Source from the content-addressed store, hash-verified

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')

Callers 1

_interpolate_bilinearFunction · 0.70

Calls 3

reshapeMethod · 0.80
name_scopeMethod · 0.45
gatherMethod · 0.45

Tested by

no test coverage detected