Skip to content

tensor updates #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beginner_source/quickstart/data_quickstart_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# You can find some of them below.
#
# - `Image Datasets <https://pytorch.org/docs/stable/torchvision/datasets.html>`_
# - `Text Datasets <https://pytorch.org/text/datasets.html)>`_
# - `Text Datasets <https://pytorch.org/text/datasets.html>`_
# - `Audio Datasets <https://pytorch.org/audio/datasets.html>`_
#

Expand Down
16 changes: 8 additions & 8 deletions beginner_source/quickstart/tensor_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


######################################################################
# **Note:** When using CPU for computations, tensors converted from arrays
# ..note: When using CPU for computations, tensors converted from arrays
# share the same memory for data. Thus, changing the underlying array will
# also affect the tensor.
#
Expand All @@ -44,7 +44,7 @@


######################################################################
# In practice, we ofter want to create tensors initialized to some values,
# In practice, we often want to create tensors initialized to some values,
# such as zeros, ones or random values. Note that you can also specify the
# type of elements using ``dtype`` parameter, and chosing one of ``torch``
# types:
Expand All @@ -56,7 +56,7 @@

######################################################################
# You can also create random tensors with values sampled from different
# distributions, as described `in
# distributions, as described `in the
# documentation <https://pytorch.org/docs/stable/torch.html#random-sampling>`__.
#
# Similarly to NumPy, you can use ``eye`` to create a diagonal identity
Expand Down Expand Up @@ -95,7 +95,7 @@
# arguments. Those operations have ``_`` appended to their name, eg.
# ``add_``.
#
# Complete reference to all tensor operations can be found `in
# Complete reference to all tensor operations can be found `in the
# documentation <https://pytorch.org/docs/stable/torch.html>`__.
#
# Let us see examples of those operations on two tensors, ``x`` and ``y``.
Expand Down Expand Up @@ -168,8 +168,8 @@
# Resizing and Indexing
# ~~~~~~~~~~~~~~~~~~~~~
#
# Very often you need to change the shape of the tensor without modifying
# its valies, eg. to add an extra dimension. To do that, you can use
# Often you need to change the shape of the tensor without modifying
# its values, eg. to add an extra dimension. To do that, you can use
# ``view`` method, which provides a **view** to the same in-memory values
# using different dimensions:
#
Expand All @@ -180,14 +180,14 @@


######################################################################
# Note that the number of elements in a view should be the same as in the
# The number of elements in a view should be the same as in the
# original tensor, and that you can use ``-1`` in one of the dimensions to
# figure out this dimension automatically.
#


######################################################################
# **Note:** ``view`` is similar to ``reshape`` operation in NumPy. There
# ..note: ``view`` is similar to ``reshape`` operation in NumPy. There
# is also a ``reshape`` method available in PyTorch, and it is more
# powerful than ``view``, because it can also reshape non-contiguous
# arrays by copying them to the new shape. However, in vast majority of
Expand Down