What is given as the input of a module is a Variable, not a Tensor.
In your case, as the error message says, layer1_mean is a Variable while new_layer is a Tensor.
You should add a new_layer = Variable(new_layer).