File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 99All of deep learning is computations on tensors, which are
1010generalizations of a matrix that can be indexed in more than 2
1111dimensions. We will see exactly what this means in-depth later. First,
12- lets look what we can do with tensors.
12+ let's look what we can do with tensors.
1313"""
1414# Author: Robert Guthrie
1515
162162# other operation, etc.)
163163#
164164# If ``requires_grad=True``, the Tensor object keeps track of how it was
165- # created. Lets see it in action.
165+ # created. Let's see it in action.
166166#
167167
168168# Tensor factory methods have a ``requires_grad`` flag
187187# But how does that help us compute a gradient?
188188#
189189
190- # Lets sum up all the entries in z
190+ # Let's sum up all the entries in z
191191s = z .sum ()
192192print (s )
193193print (s .grad_fn )
222222
223223
224224######################################################################
225- # Lets have Pytorch compute the gradient, and see that we were right:
225+ # Let's have Pytorch compute the gradient, and see that we were right:
226226# (note if you run this block multiple times, the gradient will increment.
227227# That is because Pytorch *accumulates* the gradient into the .grad
228228# property, since for many models this is very convenient.)
You can’t perform that action at this time.
0 commit comments