TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.broadcast_to

tensorplay.functional.broadcast_to(input, shape) → Tensor[source]

Broadcasts input to the shape shape. Equivalent to calling input.expand(shape). See expand() for details.

Parameters:

Example:

>>> x = tensorplay.tensor([1, 2, 3])
>>> tensorplay.broadcast_to(x, (3, 3))
tensor([[1, 2, 3],
        [1, 2, 3],
        [1, 2, 3]])

On this page

Ask DeepWiki