chainer.functions.broadcast_to

chainer.functions.broadcast_to(x, shape)[source]

Broadcast a given variable to a given shape.

Parameters:
Returns:

Output variable broadcasted to the given shape.

Return type:

Variable

Example

>>> x = np.arange(0, 3)
>>> x
array([0, 1, 2])
>>> y = F.broadcast_to(x, (3, 3))
>>> y.data
array([[0, 1, 2],
       [0, 1, 2],
       [0, 1, 2]])