Fixed bug with silent TF using 64-bit operations in 32-bit mode. (#3471)
We already cast the NumPy arrays to 32-bit, but this was not happening
if the input was tf.Variable or tf.constant.
In the process I have added some invariant checks, if core.skip_checks is
False, which it always is in testing.
Added also some sanity checking or arguments.