assert beta.shape[channel_axis] == adapt_shape[channel_axis],\
"channel size of beta: {} != channel size of x ({}).".format(beta.shape[channel_axis],
adapt_shape[channel_axis])
beta = broadcast(beta, shape=adapt_shape)
if gamma is not None and gamma.shape != adapt_shape:
assert gamma.shape[channel_axis] == adapt_shape[channel_axis], \
"channel size of gamma: {} != channel size of x ({}).".format(gamma.shape[channel_axis],