In the latest stable release (0.4.0) type() of a tensor no longer reflects the data type.
You should use tensor.type() and isinstance() instead.
Have a look at the Migration Guide 304 for more information.