64-bit integer (signed) ``torch.int64`` or ``torch.long`` ``torch.*.LongTensor``
======================== =========================================== ===========================
+To find out if a :class:`torch.dtype` is a floating point data type, the property :attr:`is_floating_point`
+can be used, which returns ``True`` if the data type is a floating point data type.
+
.. _device-doc:
torch.device
.. automethod:: int
.. automethod:: inverse
.. automethod:: is_contiguous
+ .. automethod:: is_floating_point
.. automethod:: is_pinned
.. automethod:: is_set_to
.. automethod:: is_signed
----------------------------------
.. autofunction:: is_tensor
.. autofunction:: is_storage
+.. autofunction:: is_floating_point
.. autofunction:: set_default_dtype
.. autofunction:: get_default_dtype
.. autofunction:: set_default_tensor_type
'index_put',
'is_coalesced',
'is_distributed',
- 'is_floating_point',
'is_complex',
'is_nonzero',
'is_same_size',
Returns True if :attr:`self` tensor is contiguous in memory in C order.
""")
+add_docstr_all('is_floating_point',
+ r"""
+is_floating_point() -> bool
+
+Returns True if the data type of :attr:`self` is a floating point data type.
+""")
+
add_docstr_all('is_set_to',
r"""
is_set_to(tensor) -> bool
tensor(1.9073e-06)
""")
+add_docstr(torch.is_floating_point,
+ r"""
+is_floating_point(tensor) -> (bool)
+
+Returns True if the data type of :attr:`tensor` is a floating point data type i.e.,
+one of ``torch.float64``, ``torch.float32`` and ``torch.float16``.
+
+Args:
+ tensor (Tensor): the PyTorch tensor to test
+""")
+
add_docstr(torch.kthvalue,
r"""
kthvalue(input, k, dim=None, keepdim=False, out=None) -> (Tensor, LongTensor)