---
title: thunder.clang.maybe_broadcast
description: >-
  Returns tensors with the same shape, possibly broadcasting inputs to the
  result shape.
canonical: >-
  https://lightning.ai/docs/thunder/stable/api-reference/generated/thunder.clang.maybe_broadcast
---
# thunder.clang.maybe_broadcast {#thunder-clang-maybe-broadcast}

### `thunder.clang.maybe_broadcast(*args, treat_cpu_scalar_tensors_as_numbers=True, expand_fn)` {#thunder.clang.maybe_broadcast}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/core/langctxs.py#L131-L146)

Returns tensors with the same shape, possibly broadcasting inputs to the result shape.

Parameters:

**expand\_fn** ([_Callable_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.15)")) –

---

**Navigation**

- Parent: [Generated](/docs/thunder/0.2.6/api-reference/generated.md)
