broadcast_to_shape

tfsnippet.ops.broadcast_to_shape(x, shape, name=None)

Broadcast x to match shape.

If rank(x) > len(shape), only the tail dimensions will be broadcasted to match shape.

Parameters:
  • x – A tensor.
  • shape (tuple[int] or tf.Tensor) – Broadcast x to match this shape.
Returns:

The broadcasted tensor.

Return type:

tf.Tensor