Fix trivial typos in torch.cuda._utils (#16026)
authorDerek Kim <bluewhale8202@gmail.com>
Thu, 17 Jan 2019 18:07:46 +0000 (10:07 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 17 Jan 2019 18:40:43 +0000 (10:40 -0800)
Summary:
Trivial typo fixings.

Maybe the indefinite article "an" is needed before each "specified index" but I'm not perfectly sure.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16026

Differential Revision: D13709499

Pulled By: ezyang

fbshipit-source-id: 698b000bb8aa063afd81db6e67046456a439b2ce

aten/src/TH/THTensorApply.h
torch/cuda/_utils.py

index 29e81b0..a806a11 100644 (file)
  * 1. convert the line index(the index of the element) to the indexs(coordinates) in the tensor.
  *    It can hinted by a classical problem: Getting each individual digit from a whole integer(Decimal base).
  *    A N-digit decimal base number could be view as a N-dimension tensor and the sizes of the tensor are 10.
- *    So the value the  whole interger is the line index. And the digits could be viewed as the indexes in
+ *    So the value the whole integer is the line index. And the digits could be viewed as the indexes in
  *    different dimentions.
  *
  * 2. convert the indexs(coordinates) in the tensor to the memory offset.
index 278664c..0a94a07 100644 (file)
@@ -7,11 +7,11 @@ def _get_device_index(device, optional=False):
     object, a Python integer, or ``None``.
 
     If :attr:`device` is a torch.device object, returns the device index if it
-    is a CUDA device. Note that for CUDA device without sepecified index, i.e.,
-    ``torch.devie('cuda')``, this will return the current default CUDA device if
-    :attr:`optional` is ``True``.
+    is a CUDA device. Note that for a CUDA device without a specified index,
+    i.e., ``torch.device('cuda')``, this will return the current default CUDA
+    device if :attr:`optional` is ``True``.
 
-    If :attr:`device` is a Python interger, it is returned as is.
+    If :attr:`device` is a Python integer, it is returned as is.
 
     If :attr:`device` is ``None``, this will return the current default CUDA
     device if :attr:`optional` is ``True``.
@@ -30,6 +30,6 @@ def _get_device_index(device, optional=False):
             # default cuda device index
             return torch.cuda.current_device()
         else:
-            raise ValueError('Expected a cuda device with sepecified index or '
-                             'an integer, but got: '.format(device))
+            raise ValueError('Expected a cuda device with a specified index '
+                             'or an integer, but got: '.format(device))
     return device_idx