Skip to content
Closed
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
3 changes: 2 additions & 1 deletion docs/source/tensor_attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ torch.dtype
.. class:: torch.dtype

A :class:`torch.dtype` is an object that represents the data type of a
:class:`torch.Tensor`. PyTorch has eight different data types:
:class:`torch.Tensor`. PyTorch has nine different data types:

======================== =========================================== ===========================
Data type dtype Tensor types
Expand All @@ -28,6 +28,7 @@ Data type dtype Tensor
16-bit integer (signed) ``torch.int16`` or ``torch.short`` ``torch.*.ShortTensor``
32-bit integer (signed) ``torch.int32`` or ``torch.int`` ``torch.*.IntTensor``
64-bit integer (signed) ``torch.int64`` or ``torch.long`` ``torch.*.LongTensor``
Boolean ``torch.bool`` ``torch.*.BoolTensor``
======================== =========================================== ===========================

To find out if a :class:`torch.dtype` is a floating point data type, the property :attr:`is_floating_point`
Expand Down
3 changes: 2 additions & 1 deletion docs/source/tensors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ torch.Tensor
A :class:`torch.Tensor` is a multi-dimensional matrix containing elements of
a single data type.

Torch defines eight CPU tensor types and eight GPU tensor types:
Torch defines nine CPU tensor types and nine GPU tensor types:

======================== =========================================== =========================== ================================
Data type dtype CPU tensor GPU tensor
Expand All @@ -21,6 +21,7 @@ Data type dtype CPU ten
16-bit integer (signed) ``torch.int16`` or ``torch.short`` :class:`torch.ShortTensor` :class:`torch.cuda.ShortTensor`
32-bit integer (signed) ``torch.int32`` or ``torch.int`` :class:`torch.IntTensor` :class:`torch.cuda.IntTensor`
64-bit integer (signed) ``torch.int64`` or ``torch.long`` :class:`torch.LongTensor` :class:`torch.cuda.LongTensor`
Boolean ``torch.bool`` :class:`torch.BoolTensor` :class:`torch.cuda.BoolTensor`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you lower case "Boolean".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the most common appearance is with a capitalized B? (for example, Wikipedia and Merriam Webster)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only suggested that because integer and floating point are lower cased.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because "integer" and "floating point" are correct spelling when they are lowercased, but "boolean" is generally deemed as incorrect spelling. Imagine we have a table of ["you", "they", "I"], we don't lowercase the "I".

But I can still make the change if it's important to use lowercased 'b' here. Please advise.

======================== =========================================== =========================== ================================

:class:`torch.Tensor` is an alias for the default tensor type (:class:`torch.FloatTensor`).
Expand Down