# tf.broadcast_dynamic_shape

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/ops/array_ops.py#L520-L551) |

Computes the shape of a broadcast given symbolic shapes.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.broadcast_dynamic_shape`](https://www.tensorflow.org/api_docs/python/tf/broadcast_dynamic_shape)

<br />

    tf.broadcast_dynamic_shape(
        shape_x, shape_y
    )

When `shape_x` and `shape_y` are Tensors representing shapes (i.e. the result
of calling tf.shape on another Tensor) this computes a Tensor which is the
shape of the result of a broadcasting op applied in tensors of shapes
`shape_x` and `shape_y`.

This is useful when validating the result of a broadcasting operation when the
tensors do not have statically known shapes.

#### Example:

    shape_x = (1, 2, 3)
    shape_y = (5, 1, 3)
    tf.broadcast_dynamic_shape(shape_x, shape_y)
    <tf.Tensor: shape=(3,), dtype=int32, numpy=array([5, 2, 3], ...>

<br />

<br />

<br />

| ## Args ||
|---|---|
| `shape_x` | A rank 1 integer `Tensor`, representing the shape of x. |
| `shape_y` | A rank 1 integer `Tensor`, representing the shape of y. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A rank 1 integer `Tensor` representing the broadcasted shape. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `InvalidArgumentError` | If the two shapes are incompatible for broadcasting. |

<br />