I’m using 1.0.0.dev20190312 and am not sure why .var() isn’t taking multiple dimensions in your case, but good you found a workaround.
The difference of 1e-6 is most likely created by floating point precision, so you don’t have to worry about it.
Once your custom layer works fine, we could try to write a more performant extension, so that this layer isn’t a bottleneck in your model.