broadcast_to_shape_strict

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

Broadcast x to match shape.

This method requires rank(x) to be less than or equal to len(shape). You may use broadcast_to_shape() instead, to allow the cases where rank(x) > len(shape).

Parameters:
  • x – A tensor.
  • shape (tuple[int] or tf.Tensor) – Broadcast x to match this shape.
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The broadcasted tensor.

Return type:

tf.Tensor