.data should be used carefully, as it detaches the tensor from the computation graph and might lead to wrong results.
It still has similar semantics as in the previous versions.
It’s safer to use tensor.detach() instead.