torch

若API未标明支持情况,则代表该API的支持情况待验证。

API名称

是否支持

限制与说明

torch.default_generator

     

torch.SymInt

  

torch.SymFloat

  

torch.SymBool

  

torch.Tag

  

torch.Tag.name

     

torch.is_tensor

  

torch.is_storage

  

torch.is_complex

  

torch.is_conj

     

torch.is_floating_point

  

torch.is_nonzero

  

torch.set_default_dtype

  

torch.get_default_dtype

  

torch.set_default_device

     

torch.set_default_tensor_type

不支持传入torch.npu.DtypeTensor类型

torch.numel

  

torch.set_printoptions

  

torch.set_flush_denormal

  

torch.tensor

  

torch.sparse_coo_tensor

     

torch.sparse_csr_tensor

     

torch.sparse_csc_tensor

     

torch.sparse_bsr_tensor

     

torch.sparse_bsc_tensor

     

torch.asarray

  

torch.as_tensor

  

torch.as_strided

  

torch.from_numpy

  

torch.from_dlpack

     

torch.frombuffer

  

torch.zeros

支持fp16,fp32,int64, bool

torch.zeros_like

支持fp16,fp32,int64,bool

torch.ones

支持fp16,fp32,int64

torch.ones_like

支持fp16,fp32,int64

torch.arange

支持fp16,fp32,int64,bool

torch.range

支持fp16,fp32,int64,bool

torch.linspace

     

torch.logspace

     

torch.eye

支持fp16,fp32,int64,bool

torch.empty

  

torch.empty_like

支持fp16,fp32,int64,bool

torch.empty_strided

支持fp16,fp32,int64,bool

torch.full

支持fp16,fp32,int64,bool

torch.full_like

     

torch.quantize_per_tensor

  

torch.quantize_per_channel

  

torch.dequantize

     

torch.complex

     

torch.polar

     

torch.heaviside

     

torch.adjoint

     

torch.argwhere

支持fp16,fp32,int64,bool

torch.cat

支持fp16,fp32,int64,bool

torch.concat

支持fp16,fp32,int64,bool

torch.concatenate

支持fp16,fp32,int64,bool

torch.conj

支持fp16,fp32,int64,bool

torch.chunk

支持fp16,fp32,int64,bool

torch.dsplit

支持fp16,fp32,int64,bool

torch.column_stack

     

torch.dstack

支持fp16,fp32,int64,bool

torch.gather

支持fp16,fp32,int64,bool

torch.hsplit

支持fp16,fp32,int64,bool

torch.hstack

支持fp16,fp32,int64,bool

torch.index_add

支持fp16,fp32,int64,bool

torch.index_copy

支持fp16,fp32,int64,bool

torch.index_reduce

支持fp16,fp32,int64,bool

torch.index_select

     

torch.masked_select

支持fp16,fp32,int64,bool

torch.movedim

     

torch.moveaxis

  

torch.narrow

支持fp16,fp32,int64,bool

torch.narrow_copy

支持fp16,fp32,int64,bool

torch.nonzero

支持fp16,fp32,int64,bool

torch.permute

支持fp16,fp32,int64,bool

torch.reshape

     

torch.row_stack

支持fp16,fp32,int64,bool

torch.select

     

torch.scatter

支持fp16,fp32,int64,bool

torch.diagonal_scatter

支持fp16,fp32,int64,bool

torch.select_scatter

支持fp16,fp32,int64,bool

torch.slice_scatter

     

torch.scatter_add

     

torch.scatter_reduce

     

torch.split

支持fp16,fp32,int64,bool

torch.squeeze

支持fp16,fp32,int64

torch.stack

支持fp16,fp32,int64,bool

torch.swapaxes

     

torch.swapdims

     

torch.t

  

torch.take

支持fp16,fp32,int64,bool

torch.take_along_dim

支持fp16,fp32,int64,bool

torch.tensor_split

支持fp16,fp32,int64,bool

torch.tile

支持fp16,fp32,int64,bool

torch.transpose

支持fp16,fp32,int64,bool

torch.unbind

     

torch.unsqueeze

支持fp16,fp32,int64,bool

torch.vsplit

支持fp16,fp32,int64,bool

torch.vstack

支持fp16,fp32,int64,bool

torch.where

支持fp16,fp32,int64,bool;不支持8维shape

torch.Generator

  

torch.Generator.device

     

torch.Generator.get_state

  

torch.Generator.initial_seed

  

torch.Generator.manual_seed

  

torch.Generator.seed

  

torch.Generator.set_state

  

torch.seed

  

torch.manual_seed

  

torch.initial_seed

  

torch.get_rng_state

  

torch.set_rng_state

  

torch.bernoulli

支持fp16,fp32,int64,bool

torch.multinomial

支持fp16,fp32,int64,bool

torch.normal

支持fp16,fp32,int64,bool

torch.poisson

     

torch.rand

     

torch.rand_like

支持fp16,fp32,int64,bool

torch.randint

     

torch.randint_like

支持fp16,fp32,int64,bool

torch.randn

     

torch.randn_like

支持fp16,fp32,int64,bool

torch.randperm

支持fp16,fp32,int64,bool

torch.quasirandom.SobolEngine

     

torch.quasirandom.SobolEngine.draw

     

torch.quasirandom.SobolEngine.draw_base2

     

torch.quasirandom.SobolEngine.fast_forward

     

torch.quasirandom.SobolEngine.reset

     

torch.save

  

torch.load

  

torch.get_num_threads

  

torch.set_num_threads

  

torch.get_num_interop_threads

  

torch.set_num_interop_threads

  

torch.no_grad

  

torch.enable_grad

  

torch.set_grad_enabled

  

torch.is_grad_enabled

  

torch.inference_mode

  

torch.is_inference_mode_enabled

  

torch.abs

支持fp16,fp32,int64,bool

torch.absolute

支持fp16,fp32,int64,bool

torch.acos

支持fp16,fp32,int64,bool

torch.arccos

支持fp16,fp32,int64,bool

torch.acosh

支持fp16,fp32

torch.arccosh

支持fp16,fp32

torch.add

支持fp16,fp32,int64,bool

torch.addcdiv

支持fp16,fp32,int64,bool

torch.addcmul

支持fp16,fp32,int64,bool

torch.angle

支持fp16,fp32,int64,bool

torch.asin

支持fp16,fp32,int64,bool

torch.arcsin

     

torch.asinh

支持fp16,fp32,int64,bool

torch.arcsinh

支持fp16,fp32,int64,bool

torch.atan

支持fp16,fp32,int64,bool

torch.arctan

支持fp16,fp32,int64,bool

torch.atanh

支持fp16,fp32,int64,bool

torch.arctanh

支持fp16,fp32,int64,bool

torch.atan2

     

torch.arctan2

支持fp16,fp32,int64,bool

torch.bitwise_not

支持fp16,fp32,int64,bool

torch.bitwise_and

支持fp16,fp32,int64,bool

torch.bitwise_or

支持fp16,fp32,int64,bool

torch.bitwise_xor

支持fp16,fp32,int64,bool

torch.bitwise_left_shift

     

torch.bitwise_right_shift

     

torch.ceil

支持fp16,fp32,int64,bool

torch.clamp

支持fp16,fp32,int64,bool

torch.clip

支持fp16,fp32,int64,bool

torch.conj_physical

     

torch.copysign

     

torch.cos

支持fp16,fp32,int64,bool

torch.cosh

支持fp16,fp32

torch.deg2rad

支持fp16,fp32,int64,bool

torch.div

支持fp16,fp32,int64,bool

torch.divide

支持fp16,fp32,int64,bool

torch.digamma

     

torch.erf

支持fp16,fp32,int64,bool

torch.erfc

支持fp16,fp32,int64,bool

torch.erfinv

支持fp16,fp32,int64,bool

torch.exp

支持fp16,fp32,int64,bool

torch.exp2

支持fp16,fp32,int64,bool

torch.expm1

支持fp16,fp32,int64,bool

torch.fake_quantize_per_channel_affine

     

torch.fake_quantize_per_tensor_affine

     

torch.fix

支持fp16,fp32,int64,bool

torch.float_power

支持fp16,fp32,int64,bool

torch.floor

支持fp16,fp32,int64,bool

torch.floor_divide

支持fp16,fp32,int64,bool

torch.fmod

支持fp16,fp32,int64,bool

torch.frac

     

torch.frexp

     

torch.gradient

     

torch.imag

     

torch.ldexp

支持fp16,fp32,int64,bool

torch.lerp

支持fp16,fp32,int64,bool

torch.lgamma

     

torch.log

支持fp16,fp32,int64,bool

torch.log10

     

torch.log1p

支持fp16,fp32,int64,bool

torch.log2

支持fp16,fp32,int64,bool

torch.logaddexp

支持fp16,fp32,int64,bool

torch.logaddexp2

支持fp16,fp32,int64,bool

torch.logical_and

支持fp16,fp32,int64,bool

torch.logical_not

支持fp16,fp32,int64,bool

torch.logical_or

支持fp16,fp32,int64,bool

torch.logical_xor

支持fp16,fp32,int64,bool

torch.logit

     

torch.hypot

     

torch.i0

     

torch.igamma

     

torch.igammac

     

torch.mul

支持fp16,fp32,int64,bool

torch.multiply

支持fp16,fp32,int64,bool

torch.mvlgamma

     

torch.nan_to_num

     

torch.neg

支持fp16,fp32,int64,bool

torch.negative

支持fp16,fp32,int64,bool

torch.nextafter

     

torch.polygamma

     

torch.positive

支持fp16,fp32,int64,bool

torch.pow

     

torch.quantized_batch_norm

     

torch.quantized_max_pool1d

     

torch.quantized_max_pool2d

     

torch.rad2deg

支持fp16,fp32,int64,bool

torch.real

支持fp16,fp32,int64,bool

torch.reciprocal

支持fp16,fp32,int64,bool

torch.remainder

支持fp16,fp32,int64,bool

torch.round

支持fp16,fp32,int64,bool

torch.rsqrt

支持fp16,fp32,int64,bool

torch.sigmoid

支持fp16,fp32,int64,bool

torch.sign

支持fp16,fp32,int64,bool

torch.sgn

支持fp16,fp32,int64,bool

torch.signbit

     

torch.sin

支持fp16,fp32,int64,bool

torch.sinc

     

torch.sinh

支持fp16,fp32

torch.softmax

支持fp16,fp32,int64,bool

torch.sqrt

支持fp16,fp32

torch.square

支持fp16,fp32,int64

torch.sub

支持fp16,fp32,int64

torch.subtract

     

torch.tan

支持fp16,fp32,int64

torch.tanh

支持fp16,fp32,int64

torch.true_divide

支持fp16,fp32,int64,bool

torch.trunc

支持fp16,fp32,int64,bool

torch.xlogy

支持fp16,fp32

torch.argmax

支持fp16,fp32,int64

torch.argmin

支持fp16,fp32,int64,bool

torch.amax

支持fp16,fp32,int64,bool

torch.amin

支持fp16,fp32,int64,bool

torch.aminmax

支持fp16,fp32,int64,bool

torch.all

支持fp16,fp32,int64,bool

torch.any

支持fp16,fp32,int64,bool

torch.max

支持fp16,fp32,int64,bool

torch.min

支持fp16,fp32,int64,bool

torch.dist

     

torch.logsumexp

支持fp16,fp32,int64,bool

torch.mean

支持fp16,fp32,int64,bool

torch.nanmean

     

torch.median

支持fp16,fp32,int64

torch.nanmedian

     

torch.mode

     

torch.norm

     

torch.nansum

     

torch.prod

支持fp16,fp32,int64,bool

torch.quantile

     

torch.nanquantile

     

torch.std

支持fp16,fp32

torch.std_mean

     

torch.sum

支持fp16,fp32,int64,bool;不支持dtype参数

torch.unique

支持fp16,fp32,int64,bool

torch.unique_consecutive

     

torch.var

支持fp16,fp32

torch.var_mean

     

torch.count_nonzero

支持fp16,fp32,int64,bool

torch.allclose

支持fp16,fp32,int64,bool

torch.argsort

支持fp16,fp32,int64,bool

torch.eq

支持fp16,fp32,int64,bool

torch.equal

支持fp16,fp32,int64,bool

torch.ge

支持fp16,fp32,int64,bool

torch.greater_equal

支持fp16,fp32,int64,bool

torch.gt

支持fp16,fp32,int64,bool

torch.greater

支持fp16,fp32,int64,bool

torch.isclose

支持fp16,fp32,int64,bool

torch.isfinite

支持fp16,fp32,int64,bool

torch.isin

     

torch.isinf

支持fp16,fp32,int64,bool

torch.isposinf

支持fp16,fp32,int64,bool

torch.isneginf

支持fp16,fp32,int64,bool

torch.isnan

支持fp16,fp32,int64,bool

torch.isreal

     

torch.kthvalue

支持fp16,fp32

torch.le

支持fp16,fp32,int64,bool

torch.less_equal

支持fp16,fp32,int64,bool

torch.lt

支持fp16,fp32,int64,bool

torch.less

支持fp16,fp32,int64,bool

torch.maximum

支持fp16,fp32,int64,bool

torch.minimum

支持fp16,fp32,int64,bool

torch.fmax

     

torch.fmin

     

torch.ne

支持fp16,fp32,int64,bool

torch.not_equal

支持fp16,fp32,int64,bool

torch.sort

支持fp16,fp32,int64,bool

torch.topk

支持fp16,fp32,int64,bool;不支持sorted=False场景

torch.msort

支持fp16,fp32,int64,bool

torch.stft

     

torch.istft

     

torch.bartlett_window

     

torch.blackman_window

     

torch.hamming_window

     

torch.hann_window

     

torch.kaiser_window

     

torch.atleast_1d

     

torch.atleast_2d

     

torch.atleast_3d

     

torch.bincount

支持fp16,fp32,int64,bool

torch.block_diag

支持fp16,fp32,int64,bool

torch.broadcast_tensors

支持fp16,fp32,int64,bool

torch.broadcast_to

     

torch.broadcast_shapes

支持fp16,fp32,int64,bool

torch.bucketize

     

torch.cartesian_prod

     

torch.cdist

     

torch.clone

支持fp16,fp32,int64,bool

torch.combinations

支持fp16,fp32,int64,bool

torch.corrcoef

     

torch.cov

支持fp16,fp32,int64,bool

torch.cross

     

torch.cummax

支持fp16,fp32,int64,bool

torch.cummin

     

torch.cumprod

     

torch.cumsum

支持fp16,fp32,int64,bool

torch.diag

支持fp16,fp32,int64,bool

torch.diag_embed

     

torch.diagflat

     

torch.diagonal

支持fp16,fp32,int64,bool

torch.diff

支持fp16,fp32,int64,bool

torch.einsum

支持fp16,fp32,int64,bool

torch.flatten

支持fp16,fp32,int64,bool

torch.flip

支持fp16,fp32,int64,bool

torch.fliplr

支持fp16,fp32,int64,bool

torch.flipud

支持fp16,fp32,int64,bool

torch.kron

     

torch.rot90

     

torch.gcd

     

torch.histc

支持fp16,fp32,int64,bool

torch.histogram

     

torch.histogramdd

     

torch.meshgrid

支持fp16,fp32,int64,bool

torch.lcm

     

torch.logcumsumexp

     

torch.ravel

支持fp16,fp32,int64,bool

torch.renorm

     

torch.repeat_interleave

支持fp16,fp32,int64,bool

torch.roll

支持fp16,fp32,int64,bool

torch.searchsorted

支持fp16,fp32,int64

torch.tensordot

     

torch.trace

     

torch.tril

支持fp16,fp32,int64,bool

torch.tril_indices

支持fp16,fp32,int64,bool

torch.triu

支持fp16,fp32,int64,bool

torch.triu_indices

支持fp16,fp32,int64,bool

torch.unflatten

  

torch.vander

     

torch.view_as_real

支持fp16,fp32,int64,bool

torch.view_as_complex

     

torch.resolve_conj

支持fp16,fp32,int64,bool

torch.resolve_neg

支持fp16,fp32,int64,bool

torch.addbmm

支持fp16,fp32,int64,bool

torch.addmm

支持fp16,fp32,int64,bool

torch.addmv

支持fp16,fp32,int64,bool

torch.addr

支持fp16,fp32,int64,bool

torch.baddbmm

支持fp16,fp32,int64,bool

torch.bmm

支持fp16,fp32,int64,bool

torch.chain_matmul

     

torch.cholesky

     

torch.cholesky_inverse

     

torch.cholesky_solve

     

torch.dot

支持fp16,fp32,int64,bool

torch.geqrf

     

torch.ger

     

torch.inner

     

torch.inverse

     

torch.det

     

torch.logdet

     

torch.slogdet

支持fp16,fp32,int64,bool

torch.lu

     

torch.lu_solve

     

torch.lu_unpack

     

torch.matmul

支持fp16,fp32,int64,bool

torch.matrix_power

     

torch.matrix_exp

     

torch.mm

支持fp16,fp32,int64,bool

torch.mv

     

torch.orgqr

     

torch.ormqr

     

torch.outer

     

torch.pinverse

     

torch.qr

支持fp16,fp32,int64,bool

torch.svd

     

torch.svd_lowrank

     

torch.pca_lowrank

     

torch.lobpcg

     

torch.trapz

     

torch.trapezoid

支持fp16,fp32,int64,bool

torch.cumulative_trapezoid

支持fp16,fp32,int64,bool

torch.triangular_solve

     

torch.vdot

     

torch._foreach_abs

     

torch._foreach_abs_

     

torch._foreach_acos

     

torch._foreach_acos_

     

torch._foreach_asin

     

torch._foreach_asin_

     

torch._foreach_atan

     

torch._foreach_atan_

     

torch._foreach_ceil

     

torch._foreach_ceil_

     

torch._foreach_cos

     

torch._foreach_cos_

     

torch._foreach_cosh

     

torch._foreach_cosh_

     

torch._foreach_erf

     

torch._foreach_erf_

     

torch._foreach_erfc

     

torch._foreach_erfc_

     

torch._foreach_exp

     

torch._foreach_exp_

     

torch._foreach_expm1

     

torch._foreach_expm1_

     

torch._foreach_floor

     

torch._foreach_floor_

     

torch._foreach_log

     

torch._foreach_log_

     

torch._foreach_log10

     

torch._foreach_log10_

     

torch._foreach_log1p

     

torch._foreach_log1p_

     

torch._foreach_log2

     

torch._foreach_log2_

     

torch._foreach_neg

     

torch._foreach_neg_

     

torch._foreach_tan

     

torch._foreach_tan_

     

torch._foreach_sin

     

torch._foreach_sin_

     

torch._foreach_sinh

     

torch._foreach_sinh_

     

torch._foreach_round

     

torch._foreach_round_

     

torch._foreach_sqrt

     

torch._foreach_sqrt_

     

torch._foreach_lgamma

     

torch._foreach_lgamma_

     

torch._foreach_frac

     

torch._foreach_frac_

     

torch._foreach_reciprocal

     

torch._foreach_reciprocal_

     

torch._foreach_sigmoid

     

torch._foreach_sigmoid_

     

torch._foreach_trunc

     

torch._foreach_trunc_

     

torch._foreach_zero_

     

torch.compiled_with_cxx11_abi

  

torch.result_type

  

torch.can_cast

  

torch.promote_types

  

torch.use_deterministic_algorithms

  

torch.are_deterministic_algorithms_enabled

  

torch.is_deterministic_algorithms_warn_only_enabled

     

torch.set_deterministic_debug_mode

  

torch.get_deterministic_debug_mode

  

torch.set_float32_matmul_precision

     

torch.get_float32_matmul_precision

     

torch.set_warn_always

  

torch.is_warn_always_enabled

  

torch.vmap

  

torch._assert

  

torch.sym_float

  

torch.sym_int

  

torch.sym_max

  

torch.sym_min

  

torch.sym_not

  

torch.compile