chainer.functions.broadcast¶
-
chainer.functions.broadcast(*args)[source]¶ Broadcast given variables.
- Parameters
args (
Variableor N-dimensional array) – Input variables to be broadcasted. Each dimension of the shapes of the input variables must have the same size.- Returns
Variableor tuple ofVariableobjects which are broadcasted from given arguments.- Return type
Example
>>> x = np.random.uniform(0, 1, (3, 2)).astype(np.float32) >>> y = F.broadcast(x) >>> np.all(x == y.array) True >>> z = np.random.uniform(0, 1, (3, 2)).astype(np.float32) >>> y, w = F.broadcast(x, z) >>> np.all(x == y.array) & np.all(z == w.array) True