xref: /aosp_15_r20/external/pytorch/docs/source/tensors.rst (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1.. currentmodule:: torch
2
3.. _tensor-doc:
4
5torch.Tensor
6===================================
7
8A :class:`torch.Tensor` is a multi-dimensional matrix containing elements of
9a single data type.
10
11
12Data types
13----------
14
15Torch defines tensor types with the following data types:
16
17======================================= ===========================================
18Data type                               dtype
19======================================= ===========================================
2032-bit floating point                   ``torch.float32`` or ``torch.float``
2164-bit floating point                   ``torch.float64`` or ``torch.double``
2216-bit floating point [1]_              ``torch.float16`` or ``torch.half``
2316-bit floating point [2]_              ``torch.bfloat16``
2432-bit complex                          ``torch.complex32`` or ``torch.chalf``
2564-bit complex                          ``torch.complex64`` or ``torch.cfloat``
26128-bit complex                         ``torch.complex128`` or ``torch.cdouble``
278-bit integer (unsigned)                ``torch.uint8``
2816-bit integer (unsigned)               ``torch.uint16`` (limited support) [4]_
2932-bit integer (unsigned)               ``torch.uint32`` (limited support) [4]_
3064-bit integer (unsigned)               ``torch.uint64`` (limited support) [4]_
318-bit integer (signed)                  ``torch.int8``
3216-bit integer (signed)                 ``torch.int16`` or ``torch.short``
3332-bit integer (signed)                 ``torch.int32`` or ``torch.int``
3464-bit integer (signed)                 ``torch.int64`` or ``torch.long``
35Boolean                                 ``torch.bool``
36quantized 8-bit integer (unsigned)      ``torch.quint8``
37quantized 8-bit integer (signed)        ``torch.qint8``
38quantized 32-bit integer (signed)       ``torch.qint32``
39quantized 4-bit integer (unsigned) [3]_ ``torch.quint4x2``
408-bit floating point, e4m3 [5]_         ``torch.float8_e4m3fn`` (limited support)
418-bit floating point, e5m2 [5]_         ``torch.float8_e5m2`` (limited support)
42======================================= ===========================================
43
44.. [1]
45  Sometimes referred to as binary16: uses 1 sign, 5 exponent, and 10
46  significand bits. Useful when precision is important at the expense of range.
47.. [2]
48  Sometimes referred to as Brain Floating Point: uses 1 sign, 8 exponent, and 7
49  significand bits. Useful when range is important, since it has the same
50  number of exponent bits as ``float32``
51.. [3]
52  quantized 4-bit integer is stored as a 8-bit signed integer. Currently it's only supported in EmbeddingBag operator.
53.. [4]
54  Unsigned types asides from ``uint8`` are currently planned to only have
55  limited support in eager mode (they primarily exist to assist usage with
56  torch.compile); if you need eager support and the extra range is not needed,
57  we recommend using their signed variants instead.  See
58  https://github.com/pytorch/pytorch/issues/58734 for more details.
59.. [5]
60  ``torch.float8_e4m3fn`` and ``torch.float8_e5m2`` implement the spec for 8-bit
61  floating point types from https://arxiv.org/abs/2209.05433. The op support
62  is very limited.
63
64
65For backwards compatibility, we support the following alternate class names
66for these data types:
67
68======================================= ============================= ================================
69Data type                               CPU tensor                    GPU tensor
70======================================= ============================= ================================
7132-bit floating point                   :class:`torch.FloatTensor`    :class:`torch.cuda.FloatTensor`
7264-bit floating point                   :class:`torch.DoubleTensor`   :class:`torch.cuda.DoubleTensor`
7316-bit floating point                   :class:`torch.HalfTensor`     :class:`torch.cuda.HalfTensor`
7416-bit floating point                   :class:`torch.BFloat16Tensor` :class:`torch.cuda.BFloat16Tensor`
758-bit integer (unsigned)                :class:`torch.ByteTensor`     :class:`torch.cuda.ByteTensor`
768-bit integer (signed)                  :class:`torch.CharTensor`     :class:`torch.cuda.CharTensor`
7716-bit integer (signed)                 :class:`torch.ShortTensor`    :class:`torch.cuda.ShortTensor`
7832-bit integer (signed)                 :class:`torch.IntTensor`      :class:`torch.cuda.IntTensor`
7964-bit integer (signed)                 :class:`torch.LongTensor`     :class:`torch.cuda.LongTensor`
80Boolean                                 :class:`torch.BoolTensor`     :class:`torch.cuda.BoolTensor`
81======================================= ============================= ================================
82
83However, to construct tensors, we recommend using factory functions such as
84:func:`torch.empty` with the ``dtype`` argument instead.  The
85:class:`torch.Tensor` constructor is an alias for the default tensor type
86(:class:`torch.FloatTensor`).
87
88Initializing and basic operations
89---------------------------------
90
91A tensor can be constructed from a Python :class:`list` or sequence using the
92:func:`torch.tensor` constructor:
93
94::
95
96    >>> torch.tensor([[1., -1.], [1., -1.]])
97    tensor([[ 1.0000, -1.0000],
98            [ 1.0000, -1.0000]])
99    >>> torch.tensor(np.array([[1, 2, 3], [4, 5, 6]]))
100    tensor([[ 1,  2,  3],
101            [ 4,  5,  6]])
102
103.. warning::
104
105    :func:`torch.tensor` always copies :attr:`data`. If you have a Tensor
106    :attr:`data` and just want to change its ``requires_grad`` flag, use
107    :meth:`~torch.Tensor.requires_grad_` or
108    :meth:`~torch.Tensor.detach` to avoid a copy.
109    If you have a numpy array and want to avoid a copy, use
110    :func:`torch.as_tensor`.
111
112A tensor of specific data type can be constructed by passing a
113:class:`torch.dtype` and/or a :class:`torch.device` to a
114constructor or tensor creation op:
115
116::
117
118    >>> torch.zeros([2, 4], dtype=torch.int32)
119    tensor([[ 0,  0,  0,  0],
120            [ 0,  0,  0,  0]], dtype=torch.int32)
121    >>> cuda0 = torch.device('cuda:0')
122    >>> torch.ones([2, 4], dtype=torch.float64, device=cuda0)
123    tensor([[ 1.0000,  1.0000,  1.0000,  1.0000],
124            [ 1.0000,  1.0000,  1.0000,  1.0000]], dtype=torch.float64, device='cuda:0')
125
126For more information about building Tensors, see :ref:`tensor-creation-ops`
127
128
129The contents of a tensor can be accessed and modified using Python's indexing
130and slicing notation:
131
132::
133
134    >>> x = torch.tensor([[1, 2, 3], [4, 5, 6]])
135    >>> print(x[1][2])
136    tensor(6)
137    >>> x[0][1] = 8
138    >>> print(x)
139    tensor([[ 1,  8,  3],
140            [ 4,  5,  6]])
141
142Use :meth:`torch.Tensor.item` to get a Python number from a tensor containing a
143single value:
144
145::
146
147    >>> x = torch.tensor([[1]])
148    >>> x
149    tensor([[ 1]])
150    >>> x.item()
151    1
152    >>> x = torch.tensor(2.5)
153    >>> x
154    tensor(2.5000)
155    >>> x.item()
156    2.5
157
158For more information about indexing, see :ref:`indexing-slicing-joining`
159
160A tensor can be created with :attr:`requires_grad=True` so that
161:mod:`torch.autograd` records operations on them for automatic differentiation.
162
163::
164
165    >>> x = torch.tensor([[1., -1.], [1., 1.]], requires_grad=True)
166    >>> out = x.pow(2).sum()
167    >>> out.backward()
168    >>> x.grad
169    tensor([[ 2.0000, -2.0000],
170            [ 2.0000,  2.0000]])
171
172Each tensor has an associated :class:`torch.Storage`, which holds its data.
173The tensor class also provides multi-dimensional, `strided <https://en.wikipedia.org/wiki/Stride_of_an_array>`_
174view of a storage and defines numeric operations on it.
175
176.. note::
177   For more information on tensor views, see :ref:`tensor-view-doc`.
178
179.. note::
180   For more information on the :class:`torch.dtype`, :class:`torch.device`, and
181   :class:`torch.layout` attributes of a :class:`torch.Tensor`, see
182   :ref:`tensor-attributes-doc`.
183
184.. note::
185   Methods which mutate a tensor are marked with an underscore suffix.
186   For example, :func:`torch.FloatTensor.abs_` computes the absolute value
187   in-place and returns the modified tensor, while :func:`torch.FloatTensor.abs`
188   computes the result in a new tensor.
189
190.. note::
191    To change an existing tensor's :class:`torch.device` and/or :class:`torch.dtype`, consider using
192    :meth:`~torch.Tensor.to` method on the tensor.
193
194.. warning::
195   Current implementation of :class:`torch.Tensor` introduces memory overhead,
196   thus it might lead to unexpectedly high memory usage in the applications with many tiny tensors.
197   If this is your case, consider using one large structure.
198
199
200Tensor class reference
201----------------------
202
203.. class:: Tensor()
204
205   There are a few main ways to create a tensor, depending on your use case.
206
207   - To create a tensor with pre-existing data, use :func:`torch.tensor`.
208   - To create a tensor with specific size, use ``torch.*`` tensor creation
209     ops (see :ref:`tensor-creation-ops`).
210   - To create a tensor with the same size (and similar types) as another tensor,
211     use ``torch.*_like`` tensor creation ops
212     (see :ref:`tensor-creation-ops`).
213   - To create a tensor with similar type but different size as another tensor,
214     use ``tensor.new_*`` creation ops.
215   - There is a legacy constructor ``torch.Tensor`` whose use is discouraged.
216     Use :func:`torch.tensor` instead.
217
218.. method:: Tensor.__init__(self, data)
219
220   This constructor is deprecated, we recommend using :func:`torch.tensor` instead.
221   What this constructor does depends on the type of ``data``.
222
223   * If ``data`` is a Tensor, returns an alias to the original Tensor.  Unlike
224     :func:`torch.tensor`, this tracks autograd and will propagate gradients to
225     the original Tensor.  ``device`` kwarg is not supported for this ``data`` type.
226
227   * If ``data`` is a sequence or nested sequence, create a tensor of the default
228     dtype (typically ``torch.float32``) whose data is the values in the
229     sequences, performing coercions if necessary.  Notably, this differs from
230     :func:`torch.tensor` in that this constructor will always construct a float
231     tensor, even if the inputs are all integers.
232
233   * If ``data`` is a :class:`torch.Size`, returns an empty tensor of that size.
234
235   This constructor does not support explicitly specifying ``dtype`` or ``device`` of
236   the returned tensor.  We recommend using :func:`torch.tensor` which provides this
237   functionality.
238
239   Args:
240       data (array_like): The tensor to construct from.
241
242   Keyword args:
243       device (:class:`torch.device`, optional): the desired device of returned tensor.
244           Default: if None, same :class:`torch.device` as this tensor.
245
246
247.. autoattribute:: Tensor.T
248.. autoattribute:: Tensor.H
249.. autoattribute:: Tensor.mT
250.. autoattribute:: Tensor.mH
251
252.. autosummary::
253    :toctree: generated
254    :nosignatures:
255
256    Tensor.new_tensor
257    Tensor.new_full
258    Tensor.new_empty
259    Tensor.new_ones
260    Tensor.new_zeros
261
262    Tensor.is_cuda
263    Tensor.is_quantized
264    Tensor.is_meta
265    Tensor.device
266    Tensor.grad
267    Tensor.ndim
268    Tensor.real
269    Tensor.imag
270    Tensor.nbytes
271    Tensor.itemsize
272
273    Tensor.abs
274    Tensor.abs_
275    Tensor.absolute
276    Tensor.absolute_
277    Tensor.acos
278    Tensor.acos_
279    Tensor.arccos
280    Tensor.arccos_
281    Tensor.add
282    Tensor.add_
283    Tensor.addbmm
284    Tensor.addbmm_
285    Tensor.addcdiv
286    Tensor.addcdiv_
287    Tensor.addcmul
288    Tensor.addcmul_
289    Tensor.addmm
290    Tensor.addmm_
291    Tensor.sspaddmm
292    Tensor.addmv
293    Tensor.addmv_
294    Tensor.addr
295    Tensor.addr_
296    Tensor.adjoint
297    Tensor.allclose
298    Tensor.amax
299    Tensor.amin
300    Tensor.aminmax
301    Tensor.angle
302    Tensor.apply_
303    Tensor.argmax
304    Tensor.argmin
305    Tensor.argsort
306    Tensor.argwhere
307    Tensor.asin
308    Tensor.asin_
309    Tensor.arcsin
310    Tensor.arcsin_
311    Tensor.as_strided
312    Tensor.atan
313    Tensor.atan_
314    Tensor.arctan
315    Tensor.arctan_
316    Tensor.atan2
317    Tensor.atan2_
318    Tensor.arctan2
319    Tensor.arctan2_
320    Tensor.all
321    Tensor.any
322    Tensor.backward
323    Tensor.baddbmm
324    Tensor.baddbmm_
325    Tensor.bernoulli
326    Tensor.bernoulli_
327    Tensor.bfloat16
328    Tensor.bincount
329    Tensor.bitwise_not
330    Tensor.bitwise_not_
331    Tensor.bitwise_and
332    Tensor.bitwise_and_
333    Tensor.bitwise_or
334    Tensor.bitwise_or_
335    Tensor.bitwise_xor
336    Tensor.bitwise_xor_
337    Tensor.bitwise_left_shift
338    Tensor.bitwise_left_shift_
339    Tensor.bitwise_right_shift
340    Tensor.bitwise_right_shift_
341    Tensor.bmm
342    Tensor.bool
343    Tensor.byte
344    Tensor.broadcast_to
345    Tensor.cauchy_
346    Tensor.ceil
347    Tensor.ceil_
348    Tensor.char
349    Tensor.cholesky
350    Tensor.cholesky_inverse
351    Tensor.cholesky_solve
352    Tensor.chunk
353    Tensor.clamp
354    Tensor.clamp_
355    Tensor.clip
356    Tensor.clip_
357    Tensor.clone
358    Tensor.contiguous
359    Tensor.copy_
360    Tensor.conj
361    Tensor.conj_physical
362    Tensor.conj_physical_
363    Tensor.resolve_conj
364    Tensor.resolve_neg
365    Tensor.copysign
366    Tensor.copysign_
367    Tensor.cos
368    Tensor.cos_
369    Tensor.cosh
370    Tensor.cosh_
371    Tensor.corrcoef
372    Tensor.count_nonzero
373    Tensor.cov
374    Tensor.acosh
375    Tensor.acosh_
376    Tensor.arccosh
377    Tensor.arccosh_
378    Tensor.cpu
379    Tensor.cross
380    Tensor.cuda
381    Tensor.logcumsumexp
382    Tensor.cummax
383    Tensor.cummin
384    Tensor.cumprod
385    Tensor.cumprod_
386    Tensor.cumsum
387    Tensor.cumsum_
388    Tensor.chalf
389    Tensor.cfloat
390    Tensor.cdouble
391    Tensor.data_ptr
392    Tensor.deg2rad
393    Tensor.dequantize
394    Tensor.det
395    Tensor.dense_dim
396    Tensor.detach
397    Tensor.detach_
398    Tensor.diag
399    Tensor.diag_embed
400    Tensor.diagflat
401    Tensor.diagonal
402    Tensor.diagonal_scatter
403    Tensor.fill_diagonal_
404    Tensor.fmax
405    Tensor.fmin
406    Tensor.diff
407    Tensor.digamma
408    Tensor.digamma_
409    Tensor.dim
410    Tensor.dim_order
411    Tensor.dist
412    Tensor.div
413    Tensor.div_
414    Tensor.divide
415    Tensor.divide_
416    Tensor.dot
417    Tensor.double
418    Tensor.dsplit
419    Tensor.element_size
420    Tensor.eq
421    Tensor.eq_
422    Tensor.equal
423    Tensor.erf
424    Tensor.erf_
425    Tensor.erfc
426    Tensor.erfc_
427    Tensor.erfinv
428    Tensor.erfinv_
429    Tensor.exp
430    Tensor.exp_
431    Tensor.expm1
432    Tensor.expm1_
433    Tensor.expand
434    Tensor.expand_as
435    Tensor.exponential_
436    Tensor.fix
437    Tensor.fix_
438    Tensor.fill_
439    Tensor.flatten
440    Tensor.flip
441    Tensor.fliplr
442    Tensor.flipud
443    Tensor.float
444    Tensor.float_power
445    Tensor.float_power_
446    Tensor.floor
447    Tensor.floor_
448    Tensor.floor_divide
449    Tensor.floor_divide_
450    Tensor.fmod
451    Tensor.fmod_
452    Tensor.frac
453    Tensor.frac_
454    Tensor.frexp
455    Tensor.gather
456    Tensor.gcd
457    Tensor.gcd_
458    Tensor.ge
459    Tensor.ge_
460    Tensor.greater_equal
461    Tensor.greater_equal_
462    Tensor.geometric_
463    Tensor.geqrf
464    Tensor.ger
465    Tensor.get_device
466    Tensor.gt
467    Tensor.gt_
468    Tensor.greater
469    Tensor.greater_
470    Tensor.half
471    Tensor.hardshrink
472    Tensor.heaviside
473    Tensor.histc
474    Tensor.histogram
475    Tensor.hsplit
476    Tensor.hypot
477    Tensor.hypot_
478    Tensor.i0
479    Tensor.i0_
480    Tensor.igamma
481    Tensor.igamma_
482    Tensor.igammac
483    Tensor.igammac_
484    Tensor.index_add_
485    Tensor.index_add
486    Tensor.index_copy_
487    Tensor.index_copy
488    Tensor.index_fill_
489    Tensor.index_fill
490    Tensor.index_put_
491    Tensor.index_put
492    Tensor.index_reduce_
493    Tensor.index_reduce
494    Tensor.index_select
495    Tensor.indices
496    Tensor.inner
497    Tensor.int
498    Tensor.int_repr
499    Tensor.inverse
500    Tensor.isclose
501    Tensor.isfinite
502    Tensor.isinf
503    Tensor.isposinf
504    Tensor.isneginf
505    Tensor.isnan
506    Tensor.is_contiguous
507    Tensor.is_complex
508    Tensor.is_conj
509    Tensor.is_floating_point
510    Tensor.is_inference
511    Tensor.is_leaf
512    Tensor.is_pinned
513    Tensor.is_set_to
514    Tensor.is_shared
515    Tensor.is_signed
516    Tensor.is_sparse
517    Tensor.istft
518    Tensor.isreal
519    Tensor.item
520    Tensor.kthvalue
521    Tensor.lcm
522    Tensor.lcm_
523    Tensor.ldexp
524    Tensor.ldexp_
525    Tensor.le
526    Tensor.le_
527    Tensor.less_equal
528    Tensor.less_equal_
529    Tensor.lerp
530    Tensor.lerp_
531    Tensor.lgamma
532    Tensor.lgamma_
533    Tensor.log
534    Tensor.log_
535    Tensor.logdet
536    Tensor.log10
537    Tensor.log10_
538    Tensor.log1p
539    Tensor.log1p_
540    Tensor.log2
541    Tensor.log2_
542    Tensor.log_normal_
543    Tensor.logaddexp
544    Tensor.logaddexp2
545    Tensor.logsumexp
546    Tensor.logical_and
547    Tensor.logical_and_
548    Tensor.logical_not
549    Tensor.logical_not_
550    Tensor.logical_or
551    Tensor.logical_or_
552    Tensor.logical_xor
553    Tensor.logical_xor_
554    Tensor.logit
555    Tensor.logit_
556    Tensor.long
557    Tensor.lt
558    Tensor.lt_
559    Tensor.less
560    Tensor.less_
561    Tensor.lu
562    Tensor.lu_solve
563    Tensor.as_subclass
564    Tensor.map_
565    Tensor.masked_scatter_
566    Tensor.masked_scatter
567    Tensor.masked_fill_
568    Tensor.masked_fill
569    Tensor.masked_select
570    Tensor.matmul
571    Tensor.matrix_power
572    Tensor.matrix_exp
573    Tensor.max
574    Tensor.maximum
575    Tensor.mean
576    Tensor.module_load
577    Tensor.nanmean
578    Tensor.median
579    Tensor.nanmedian
580    Tensor.min
581    Tensor.minimum
582    Tensor.mm
583    Tensor.smm
584    Tensor.mode
585    Tensor.movedim
586    Tensor.moveaxis
587    Tensor.msort
588    Tensor.mul
589    Tensor.mul_
590    Tensor.multiply
591    Tensor.multiply_
592    Tensor.multinomial
593    Tensor.mv
594    Tensor.mvlgamma
595    Tensor.mvlgamma_
596    Tensor.nansum
597    Tensor.narrow
598    Tensor.narrow_copy
599    Tensor.ndimension
600    Tensor.nan_to_num
601    Tensor.nan_to_num_
602    Tensor.ne
603    Tensor.ne_
604    Tensor.not_equal
605    Tensor.not_equal_
606    Tensor.neg
607    Tensor.neg_
608    Tensor.negative
609    Tensor.negative_
610    Tensor.nelement
611    Tensor.nextafter
612    Tensor.nextafter_
613    Tensor.nonzero
614    Tensor.norm
615    Tensor.normal_
616    Tensor.numel
617    Tensor.numpy
618    Tensor.orgqr
619    Tensor.ormqr
620    Tensor.outer
621    Tensor.permute
622    Tensor.pin_memory
623    Tensor.pinverse
624    Tensor.polygamma
625    Tensor.polygamma_
626    Tensor.positive
627    Tensor.pow
628    Tensor.pow_
629    Tensor.prod
630    Tensor.put_
631    Tensor.qr
632    Tensor.qscheme
633    Tensor.quantile
634    Tensor.nanquantile
635    Tensor.q_scale
636    Tensor.q_zero_point
637    Tensor.q_per_channel_scales
638    Tensor.q_per_channel_zero_points
639    Tensor.q_per_channel_axis
640    Tensor.rad2deg
641    Tensor.random_
642    Tensor.ravel
643    Tensor.reciprocal
644    Tensor.reciprocal_
645    Tensor.record_stream
646    Tensor.register_hook
647    Tensor.register_post_accumulate_grad_hook
648    Tensor.remainder
649    Tensor.remainder_
650    Tensor.renorm
651    Tensor.renorm_
652    Tensor.repeat
653    Tensor.repeat_interleave
654    Tensor.requires_grad
655    Tensor.requires_grad_
656    Tensor.reshape
657    Tensor.reshape_as
658    Tensor.resize_
659    Tensor.resize_as_
660    Tensor.retain_grad
661    Tensor.retains_grad
662    Tensor.roll
663    Tensor.rot90
664    Tensor.round
665    Tensor.round_
666    Tensor.rsqrt
667    Tensor.rsqrt_
668    Tensor.scatter
669    Tensor.scatter_
670    Tensor.scatter_add_
671    Tensor.scatter_add
672    Tensor.scatter_reduce_
673    Tensor.scatter_reduce
674    Tensor.select
675    Tensor.select_scatter
676    Tensor.set_
677    Tensor.share_memory_
678    Tensor.short
679    Tensor.sigmoid
680    Tensor.sigmoid_
681    Tensor.sign
682    Tensor.sign_
683    Tensor.signbit
684    Tensor.sgn
685    Tensor.sgn_
686    Tensor.sin
687    Tensor.sin_
688    Tensor.sinc
689    Tensor.sinc_
690    Tensor.sinh
691    Tensor.sinh_
692    Tensor.asinh
693    Tensor.asinh_
694    Tensor.arcsinh
695    Tensor.arcsinh_
696    Tensor.shape
697    Tensor.size
698    Tensor.slogdet
699    Tensor.slice_scatter
700    Tensor.softmax
701    Tensor.sort
702    Tensor.split
703    Tensor.sparse_mask
704    Tensor.sparse_dim
705    Tensor.sqrt
706    Tensor.sqrt_
707    Tensor.square
708    Tensor.square_
709    Tensor.squeeze
710    Tensor.squeeze_
711    Tensor.std
712    Tensor.stft
713    Tensor.storage
714    Tensor.untyped_storage
715    Tensor.storage_offset
716    Tensor.storage_type
717    Tensor.stride
718    Tensor.sub
719    Tensor.sub_
720    Tensor.subtract
721    Tensor.subtract_
722    Tensor.sum
723    Tensor.sum_to_size
724    Tensor.svd
725    Tensor.swapaxes
726    Tensor.swapdims
727    Tensor.t
728    Tensor.t_
729    Tensor.tensor_split
730    Tensor.tile
731    Tensor.to
732    Tensor.to_mkldnn
733    Tensor.take
734    Tensor.take_along_dim
735    Tensor.tan
736    Tensor.tan_
737    Tensor.tanh
738    Tensor.tanh_
739    Tensor.atanh
740    Tensor.atanh_
741    Tensor.arctanh
742    Tensor.arctanh_
743    Tensor.tolist
744    Tensor.topk
745    Tensor.to_dense
746    Tensor.to_sparse
747    Tensor.to_sparse_csr
748    Tensor.to_sparse_csc
749    Tensor.to_sparse_bsr
750    Tensor.to_sparse_bsc
751    Tensor.trace
752    Tensor.transpose
753    Tensor.transpose_
754    Tensor.triangular_solve
755    Tensor.tril
756    Tensor.tril_
757    Tensor.triu
758    Tensor.triu_
759    Tensor.true_divide
760    Tensor.true_divide_
761    Tensor.trunc
762    Tensor.trunc_
763    Tensor.type
764    Tensor.type_as
765    Tensor.unbind
766    Tensor.unflatten
767    Tensor.unfold
768    Tensor.uniform_
769    Tensor.unique
770    Tensor.unique_consecutive
771    Tensor.unsqueeze
772    Tensor.unsqueeze_
773    Tensor.values
774    Tensor.var
775    Tensor.vdot
776    Tensor.view
777    Tensor.view_as
778    Tensor.vsplit
779    Tensor.where
780    Tensor.xlogy
781    Tensor.xlogy_
782    Tensor.xpu
783    Tensor.zero_
784