Changing the datatype of tensors