MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get

Function get

examples/OpticalFlow/flownet_models.py:99–102  ·  view source on GitHub ↗
(y, x)

Source from the content-addressed store, hash-verified

97 batch_ids = tf.tile(tf.expand_dims(tf.expand_dims(tf.range(B), axis=-1), axis=-1), [1, h, w])
98
99 def get(y, x):
100 idx = tf.reshape(batch_ids * h * w + y * w + x, [-1])
101 idx = tf.cast(idx, tf.int32)
102 return tf.gather(img_flat, idx)
103
104 val = tf.zeros_like(alpha)
105 val += (1 - alpha) * (1 - beta) * tf.reshape(get(yT, xL), [-1, h, w, c])

Callers 1

resampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected