# Linear Regression Implementation from Scratch

**URL:** <https://d2l.discourse.group/t/linear-regression-implementation-from-scratch/43>\
**Category:** pytorch\
**Created:** [May 27, 2020, 9:14pm UTC](https://d2l.discourse.group/t/linear-regression-implementation-from-scratch/43 "2020-05-27T21:14:49Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![StevenJokes](https://yyz2.discourse-cdn.com/free1/user_avatar/d2l.discourse.group/stevenjokes/32/437_2.png) [@StevenJokes](https://d2l.discourse.group/u/StevenJokes)\
**Post date:** [June 16, 2020, 10:38am UTC](https://d2l.discourse.group/t/linear-regression-implementation-from-scratch/43/19 "2020-06-16T10:38:37Z")

</div>

You meant my github’s issue?  
My issue is about " 2.5.2 does’t have PyTorch’s version."

> [@Auto Differentiation](http://d2l.discourse.group/t/auto-differentiation/35/9):
>
> Q1. Does it mean that if I ‘clone’ a tensor or a Variable that has requires\_grad attribute, then I don’t need to .requires\_grad() for the new one? Use detach() to remove a tensor? However, why can I still judge x.grad() == u.grad? “Remove” doesn’t mean that x will not exist? I think that x and u are just two different names for the same storage. Can my code about 2.5.2’s Variable add to 2.5.2? Q2. I have understand that d is a function of which scales a. But what difference with f(b)? …

I have heard that Variable has merge into tensor from zhihu.  
Is it right?  
If so, 2.5.2 doesn’t need PyTorch’s version.

---

_[View the full topic](https://d2l.discourse.group/t/linear-regression-implementation-from-scratch/43)._
