<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def explained_variance(returns, values):
 """ Calculate how much variance in returns do the values explain """

    exp_var = 1 - torch.var(returns - values) / torch.var(returns)
    return exp_var.item()