MCPcopy Create free account
hub / github.com/google-research/language / _tile_batch

Function _tile_batch

language/capwap/utils/tensor_utils.py:113–120  ·  view source on GitHub ↗

Core single-tensor implementation of tile_batch.

(t, multiplier)

Source from the content-addressed store, hash-verified

111 """
112
113 def _tile_batch(t, multiplier):
114 """Core single-tensor implementation of tile_batch."""
115 tensor = tf.convert_to_tensor(t)
116 tensor = tf.expand_dims(tensor, axis=1)
117 tile_dims = [1] * tensor.shape.ndims
118 tile_dims[1] = multiplier
119 tiled = tf.tile(tensor, tile_dims)
120 return tf.reshape(tiled, [-1] + shape(tensor)[2:])
121
122 return tf.nest.map_structure(lambda t_: _tile_batch(t_, multiplier), t)
123

Callers 1

tile_batchFunction · 0.85

Calls 1

shapeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…