def bias(x, y, axis=1):
 x_shape = x.shape
 y_shape = y.shape
 if chainer.is_debug():
  assert (x_shape[axis:(axis + len(y_shape))] == y_shape)
 y1_shape = tuple(((([1] * axis) + list(y_shape)) + ([1] * ((len(x_shape) - axis) - len(y_shape)))))
 y1 = reshape.reshape(y, y1_shape)
 y2 = broadcast.broadcast_to(y1, x_shape)
 return (x + y2)

def bias ( x , y , axis = 1 ) : x_shape = x . shape y_shape = y . shape if chainer . is_debug ( ) : assert ( x_shape [ axis : ( axis + len ( y_shape ) ) ] == y_shape ) y1_shape = tuple ( ( ( ( [ 1 ] * axis ) + list ( y_shape ) ) + ( [ 1 ] * ( ( len ( x_shape ) - axis ) - len ( y_shape ) ) ) ) ) y1 = reshape . reshape ( y , y1_shape ) y2 = broadcast . broadcast_to ( y1 , x_shape ) return ( x + y2 )
elementwise summation with broadcasting .