<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 deatch()
Step1:  tensor.data returns a new tensor that shares storage with tensor. However, it always has requires_grad=False (even if the original tensor had requires_grad=True
<ASSISTANT_TASK:>
Python Code:
# a is a tensor with require grad
a = torch.tensor(2., requires_grad=True);a
b = a.detach();b # with deatch() no grad. 
Explanation: deatch():  https://discuss.pytorch.org/t/clone-and-detach-in-v0-4-0/16861
tensor.detach() creates a tensor that shares storage with tensor that does not require grad.
End of explanation
c = a.data;c
d = a.item();d
Explanation: tensor.data returns a new tensor that shares storage with tensor. However, it always has requires_grad=False (even if the original tensor had requires_grad=True
End of explanation
<END_TASK>