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: Variable Example
>>> x = np.random.uniform(0, 1, (3, 2)).astype(np.float32) >>> y = F.broadcast(x) >>> np.all(x == y.data) True >>> z = np.random.uniform(0, 1, (3, 2)).astype(np.float32) >>> y, w = F.broadcast(x, z) >>> np.all(x == y.data) & np.all(z == w.data) True