# PyTorch API Support - [Tensors](#tensorsmd) - [Generators](#generatorsmd) - [Random sampling](#random-samplingmd) - [Serialization](#serializationmd) - [Math operations](#math-operationsmd) - [Utilities](#utilitiesmd) - [Other](#othermd) - [torch.Tensor](#torch-tensormd) - [Layers \(torch.nn\)](#layers-torch-nnmd) - [Functions\(torch.nn.functional\)](#functionstorch-nn-functionalmd) - [torch.distributed](#torch-distributedmd) - [NPU and CUDA Function Alignment](#npu-and-cuda-function-alignmentmd)

Tensors

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.is_tensor

Supported

2

torch.is_storage

Supported

3

torch.is_complex

Unsupported

4

torch.is_floating_point

Supported

5

torch.set_default_dtype

Supported

6

torch.get_default_dtype

Supported

7

torch.set_default_tensor_type

Supported

8

torch.numel

Supported

9

torch.set_printoptions

Supported

10

torch.set_flush_denormal

Supported

11

torch.tensor

Supported

12

torch.sparse_coo_tensor

Unsupported

13

torch.as_tensor

Supported

14

torch.as_strided

Supported

15

torch.from_numpy

Supported

16

torch.zeros

Supported

17

torch.zeros_like

Supported

18

torch.ones

Supported

19

torch.ones_like

Supported

20

torch.arange

Supported

21

torch.range

Supported

22

torch.linspace

Supported

23

torch.logspace

Supported

24

torch.eye

Supported

25

torch.empty

Supported

26

torch.empty_like

Supported

27

torch.empty_strided

Supported

28

torch.full

Supported

29

torch.full_like

Supported

30

torch.quantize_per_tensor

Supported

31

torch.quantize_per_channel

Unsupported

32

torch.cat

Supported

33

torch.chunk

Supported

34

torch.gather

Supported

35

torch.index_select

Supported

36

torch.masked_select

Supported

37

torch.narrow

Supported

38

torch.nonzero

Supported

39

torch.reshape

Supported

40

torch.split

Supported

41

torch.squeeze

Supported

42

torch.stack

Supported

43

torch.t

Supported

44

torch.take

Supported

45

torch.transpose

Supported

46

torch.unbind

Supported

47

torch.unsqueeze

Supported

48

torch.where

Supported

Generators

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch._C.Generator

Unsupported

2

torch._C.Generator.device

Unsupported

3

torch._C.Generator.get_state

Unsupported

4

torch._C.Generator.initial_seed

Unsupported

5

torch._C.Generator.manual_seed

Unsupported

6

torch._C.Generator.seed

Unsupported

7

torch._C.Generator.set_state

Unsupported

Random sampling

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.seed

Unsupported

2

torch.manual_seed

Unsupported

3

torch.initial_seed

Unsupported

4

torch.get_rng_state

Unsupported

5

torch.set_rng_state

Unsupported

6

torch.torch.default_generator

Unsupported

7

torch.bernoulli

Supported

8

torch.multinomial

Supported

9

torch.normal

Supported

10

torch.poisson

Unsupported

11

torch.rand

Supported

12

torch.rand_like

Supported

13

torch.randint

Supported

14

torch.randint_like

Supported

15

torch.randn

Supported

16

torch.randn_like

Supported

17

torch.randperm

Supported

18

torch.Tensor.bernoulli_()

Supported

19

torch.Tensor.bernoulli_()

Supported

20

torch.Tensor.exponential_()

Unsupported

21

torch.Tensor.geometric_()

Unsupported

22

torch.Tensor.log_normal_()

Unsupported

23

torch.Tensor.normal_()

Supported

24

torch.Tensor.random_()

Supported

25

torch.Tensor.uniform_()

Supported

26

torch.quasirandom.SobolEngine

Unsupported

27

torch.quasirandom.SobolEngine.draw

Unsupported

28

torch.quasirandom.SobolEngine.fast_forward

Unsupported

29

torch.quasirandom.SobolEngine.reset

Unsupported

Serialization

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.save

Supported

2

torch.load

Supported

Math operations

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.abs

Supported

2

torch.acos

Supported

3

torch.add

Supported

4

torch.addcdiv

Supported

5

torch.addcmul

Supported

6

torch.angle

Unsupported

7

torch.asin

Supported

8

torch.atan

Supported

9

torch.atan2

Supported

10

torch.bitwise_not

Supported

11

torch.bitwise_and

Supported

12

torch.bitwise_or

Supported

13

torch.bitwise_xor

Supported

14

torch.ceil

Supported

15

torch.clamp

Supported

16

torch.conj

Unsupported

17

torch.cos

Supported

18

torch.cosh

Supported

19

torch.div

Supported

20

torch.digamma

Unsupported

21

torch.erf

Supported

22

torch.erfc

Unsupported

23

torch.erfinv

Supported

24

torch.exp

Supported

25

torch.expm1

Supported

26

torch.floor

Supported

27

torch.floor_divide

Supported

28

torch.fmod

Supported

29

torch.frac

Supported

30

torch.imag

Unsupported

31

torch.lerp

Supported

32

torch.lgamma

Unsupported

33

torch.log

Supported

34

torch.log10

Supported

35

torch.log1p

Supported

36

torch.log2

Supported

37

torch.logical_and

Supported

38

torch.logical_not

Supported

39

torch.logical_or

Supported

40

torch.logical_xor

Supported

41

torch.mul

Supported

42

torch.mvlgamma

Unsupported

43

torch.neg

Supported

44

torch.polygamma

Unsupported

45

torch.pow

Supported

46

torch.real

Supported

47

torch.reciprocal

Supported

48

torch.remainder

Supported

49

torch.round

Supported

50

torch.rsqrt

Supported

51

torch.sigmoid

Supported

52

torch.sign

Supported

53

torch.sin

Supported

54

torch.sinh

Supported

55

torch.sqrt

Supported

56

torch.square

Supported

57

torch.tan

Supported

58

torch.tanh

Supported

59

torch.true_divide

Supported

60

torch.trunc

Supported

61

torch.argmax

Supported

62

torch.argmin

Supported

63

torch.dist

Supported

64

torch.logsumexp

Supported

65

torch.mean

Supported

66

torch.median

Supported

67

torch.mode

Unsupported

68

torch.norm

Supported

69

torch.prod

Supported

70

torch.std

Supported

71

torch.std_mean

Supported

72

torch.sum

Supported

73

torch.unique

Supported

74

torch.unique_consecutive

Unsupported

75

torch.var

Unsupported

76

torch.var_mean

Unsupported

77

torch.allclose

Supported

78

torch.argsort

Supported

79

torch.eq

Supported

80

torch.equal

Supported

81

torch.ge

Supported

82

torch.gt

Supported

83

torch.isfinite

Supported

84

torch.isinf

Supported

85

torch.isnan

Supported

86

torch.kthvalue

Supported

87

torch.le

Supported

88

torch.lt

Supported

89

torch.max

Supported

90

torch.min

Supported

91

torch.ne

Supported

92

torch.sort

Supported

93

torch.topk

Supported

94

torch.fft

Unsupported

95

torch.ifft

Unsupported

96

torch.rfft

Unsupported

97

torch.irfft

Unsupported

98

torch.stft

Unsupported

99

torch.bartlett_window

Supported

100

torch.blackman_window

Supported

101

torch.hamming_window

Supported

102

torch.hann_window

Supported

103

torch.bincount

Unsupported

104

torch.broadcast_tensors

Supported

105

torch.cartesian_prod

Supported

106

torch.cdist

Supported

107

torch.combinations

Unsupported

108

torch.cross

Supported

109

torch.cummax

Supported

110

torch.cummin

Supported

111

torch.cumprod

Supported

112

torch.cumsum

Supported

113

torch.diag

Supported

114

torch.diag_embed

Supported

115

torch.diagflat

Supported

116

torch.diagonal

Supported

117

torch.einsum

Supported

118

torch.flatten

Supported

119

torch.flip

Supported

120

torch.rot90

Supported

121

torch.histc

Unsupported

122

torch.meshgrid

Supported

123

torch.renorm

Supported

124

torch.repeat_interleave

Unsupported

125

torch.roll

Unsupported

126

torch.tensordot

Supported

127

torch.trace

Unsupported

128

torch.tril

Supported

129

torch.tril_indices

Unsupported

130

torch.triu

Supported

131

torch.triu_indices

Supported

132

torch.addbmm

Supported

133

torch.addmm

Supported

134

torch.addmv

Supported

135

torch.addr

Supported

136

torch.baddbmm

Supported

137

torch.bmm

Supported

138

torch.chain_matmul

Supported

139

torch.cholesky

Unsupported

140

torch.cholesky_inverse

Unsupported

141

torch.cholesky_solve

Unsupported

142

torch.dot

Supported

143

torch.eig

Unsupported

144

torch.geqrf

Unsupported

145

torch.ger

Supported

146

torch.inverse

Supported

147

torch.det

Unsupported

148

torch.logdet

Unsupported

149

torch.slogdet

Supported

150

torch.lstsq

Unsupported

151

torch.lu

Unsupported

152

torch.lu_solve

Unsupported

153

torch.lu_unpack

Unsupported

154

torch.matmul

Supported

155

torch.matrix_power

Supported

156

torch.matrix_rank

Supported

157

torch.mm

Supported

158

torch.mv

Supported

159

torch.orgqr

Unsupported

160

torch.ormqr

Unsupported

161

torch.pinverse

Unsupported

162

torch.qr

Supported

163

torch.solve

Unsupported

164

torch.svd

Supported

165

torch.svd_lowrank

Unsupported

166

torch.pca_lowrank

Unsupported

167

torch.symeig

Supported

168

torch.lobpcg

Unsupported

169

torch.trapz

Supported

170

torch.triangular_solve

Supported

Utilities

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.compiled_with_cxx11_abi

Supported

2

torch.result_type

Supported

3

torch.can_cast

Supported

4

torch.promote_types

Supported

Other

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.no_grad

Supported

2

torch.enable_grad

Supported

3

torch.set_grad_enabled

Supported

4

torch.get_num_threads

Supported

5

torch.set_num_threads

Supported

6

torch.get_num_interop_threads

Supported

7

torch.set_num_interop_threads

Supported

torch.Tensor

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.Tensor

Supported

2

torch.Tensor.new_tensor

Supported

3

torch.Tensor.new_full

Supported

4

torch.Tensor.new_empty

Supported

5

torch.Tensor.new_ones

Supported

6

torch.Tensor.new_zeros

Supported

7

torch.Tensor.is_cuda

Supported

8

torch.Tensor.is_quantized

Supported

9

torch.Tensor.device

Supported

10

torch.Tensor.ndim

Supported

11

torch.Tensor.T

Supported

12

torch.Tensor.abs

Supported

13

torch.Tensor.abs_

Supported

14

torch.Tensor.acos

Supported

15

torch.Tensor.acos_

Supported

16

torch.Tensor.add

Supported

17

torch.Tensor.add_

Supported

18

torch.Tensor.addbmm

Supported

19

torch.Tensor.addbmm_

Supported

20

torch.Tensor.addcdiv

Supported

21

torch.Tensor.addcdiv_

Supported

22

torch.Tensor.addcmul

Supported

23

torch.Tensor.addcmul_

Supported

24

torch.Tensor.addmm

Supported

25

torch.Tensor.addmm_

Supported

26

torch.Tensor.addmv

Supported

27

torch.Tensor.addmv_

Supported

28

torch.Tensor.addr

Supported

29

torch.Tensor.addr_

Supported

30

torch.Tensor.allclose

Supported

31

torch.Tensor.angle

Unsupported

32

torch.Tensor.apply_

Unsupported

33

torch.Tensor.argmax

Supported

34

torch.Tensor.argmin

Supported

35

torch.Tensor.argsort

Supported

36

torch.Tensor.asin

Supported

37

torch.Tensor.asin_

Supported

38

torch.Tensor.as_strided

Supported

39

torch.Tensor.atan

Supported

40

torch.Tensor.atan2

Supported

41

torch.Tensor.atan2_

Supported

42

torch.Tensor.atan_

Supported

43

torch.Tensor.baddbmm

Supported

44

torch.Tensor.baddbmm_

Supported

45

torch.Tensor.bernoulli

Supported

46

torch.Tensor.bernoulli_

Supported

47

torch.Tensor.bfloat16

Unsupported

48

torch.Tensor.bincount

Unsupported

49

torch.Tensor.bitwise_not

Supported

50

torch.Tensor.bitwise_not_

Supported

51

torch.Tensor.bitwise_and

Supported

52

torch.Tensor.bitwise_and_

Supported

53

torch.Tensor.bitwise_or

Supported

54

torch.Tensor.bitwise_or_

Supported

55

torch.Tensor.bitwise_xor

Supported

56

torch.Tensor.bitwise_xor_

Supported

57

torch.Tensor.bmm

Supported

58

torch.Tensor.bool

Supported

59

torch.Tensor.byte

Supported

60

torch.Tensor.cauchy_

Unsupported

61

torch.Tensor.ceil

Supported

62

torch.Tensor.ceil_

Supported

63

torch.Tensor.char

Supported

64

torch.Tensor.cholesky

Unsupported

65

torch.Tensor.cholesky_inverse

Unsupported

66

torch.Tensor.cholesky_solve

Unsupported

67

torch.Tensor.chunk

Supported

68

torch.Tensor.clamp

Supported

69

torch.Tensor.clamp_

Supported

70

torch.Tensor.clone

Supported

71

torch.Tensor.contiguous

Supported

72

torch.Tensor.copy_

Supported

73

torch.Tensor.conj

Unsupported

74

torch.Tensor.cos

Supported

75

torch.Tensor.cos_

Supported

76

torch.Tensor.cosh

Supported

77

torch.Tensor.cosh_

Supported

78

torch.Tensor.cpu

Supported

79

torch.Tensor.cross

Supported

80

torch.Tensor.cuda

Unsupported

81

torch.Tensor.cummax

Supported

82

torch.Tensor.cummin

Supported

83

torch.Tensor.cumprod

Supported

84

torch.Tensor.cumsum

Supported

85

torch.Tensor.data_ptr

Supported

86

torch.Tensor.dequantize

Unsupported

87

torch.Tensor.det

Unsupported

88

torch.Tensor.dense_dim

Unsupported

89

torch.Tensor.diag

Supported

90

torch.Tensor.diag_embed

Supported

91

torch.Tensor.diagflat

Supported

92

torch.Tensor.diagonal

Supported

93

torch.Tensor.fill_diagonal_

Supported

94

torch.Tensor.digamma

Unsupported

95

torch.Tensor.digamma_

Unsupported

96

torch.Tensor.dim

Supported

97

torch.Tensor.dist

Supported

98

torch.Tensor.div

Supported

99

torch.Tensor.div_

Supported

100

torch.Tensor.dot

Supported

101

torch.Tensor.double

Unsupported

102

torch.Tensor.eig

Unsupported

103

torch.Tensor.element_size

Supported

104

torch.Tensor.eq

Supported

105

torch.Tensor.eq_

Supported

106

torch.Tensor.equal

Supported

107

torch.Tensor.erf

Supported

108

torch.Tensor.erf_

Supported

109

torch.Tensor.erfc

Supported

110

torch.Tensor.erfc_

Supported

111

torch.Tensor.erfinv

Supported

112

torch.Tensor.erfinv_

Supported

113

torch.Tensor.exp

Supported

114

torch.Tensor.exp_

Supported

115

torch.Tensor.expm1

Supported

116

torch.Tensor.expm1_

Supported

117

torch.Tensor.expand

Supported

118

torch.Tensor.expand_as

Supported

119

torch.Tensor.exponential_

Unsupported

120

torch.Tensor.fft

Unsupported

121

torch.Tensor.fill_

Supported

122

torch.Tensor.flatten

Supported

123

torch.Tensor.flip

Supported

124

torch.Tensor.float

Supported

125

torch.Tensor.floor

Supported

126

torch.Tensor.floor_

Supported

127

torch.Tensor.floor_divide

Supported

128

torch.Tensor.floor_divide_

Supported

129

torch.Tensor.fmod

Supported

130

torch.Tensor.fmod_

Supported

131

torch.Tensor.frac

Supported

132

torch.Tensor.frac_

Supported

133

torch.Tensor.gather

Supported

134

torch.Tensor.ge

Supported

135

torch.Tensor.ge_

Supported

136

torch.Tensor.geometric_

Unsupported

137

torch.Tensor.geqrf

Unsupported

138

torch.Tensor.ger

Supported

139

torch.Tensor.get_device

Supported

140

torch.Tensor.gt

Supported

141

torch.Tensor.gt_

Supported

142

torch.Tensor.half

Supported

143

torch.Tensor.hardshrink

Supported

144

torch.Tensor.histc

Unsupported

145

torch.Tensor.ifft

Unsupported

146

torch.Tensor.index_add_

Supported

147

torch.Tensor.index_add

Supported

148

torch.Tensor.index_copy_

Supported

149

torch.Tensor.index_copy

Supported

150

torch.Tensor.index_fill_

Supported

151

torch.Tensor.index_fill

Supported

152

torch.Tensor.index_put_

Supported

153

torch.Tensor.index_put

Supported

154

torch.Tensor.index_select

Supported

155

torch.Tensor.indices

Unsupported

156

torch.Tensor.int

Supported

157

torch.Tensor.int_repr

Unsupported

158

torch.Tensor.inverse

Supported

159

torch.Tensor.irfft

Unsupported

160

torch.Tensor.is_contiguous

Supported

161

torch.Tensor.is_complex

Supported

162

torch.Tensor.is_floating_point

Supported

163

torch.Tensor.is_pinned

Supported

164

torch.Tensor.is_set_to

Unsupported

165

torch.Tensor.is_shared

Supported

166

torch.Tensor.is_signed

Supported

167

torch.Tensor.is_sparse

Supported

168

torch.Tensor.item

Supported

169

torch.Tensor.kthvalue

Supported

170

torch.Tensor.le

Supported

171

torch.Tensor.le_

Supported

172

torch.Tensor.lerp

Supported

173

torch.Tensor.lerp_

Supported

174

torch.Tensor.lgamma

Unsupported

175

torch.Tensor.lgamma_

Unsupported

176

torch.Tensor.log

Supported

177

torch.Tensor.log_

Supported

178

torch.Tensor.logdet

Unsupported

179

torch.Tensor.log10

Supported

180

torch.Tensor.log10_

Supported

181

torch.Tensor.log1p

Supported

182

torch.Tensor.log1p_

Supported

183

torch.Tensor.log2

Supported

184

torch.Tensor.log2_

Supported

185

torch.Tensor.log_normal_

Supported

186

torch.Tensor.logsumexp

Supported

187

torch.Tensor.logical_and

Supported

188

torch.Tensor.logical_and_

Supported

189

torch.Tensor.logical_not

Supported

190

torch.Tensor.logical_not_

Supported

191

torch.Tensor.logical_or

Supported

192

torch.Tensor.logical_or_

Supported

193

torch.Tensor.logical_xor

Unsupported

194

torch.Tensor.logical_xor_

Unsupported

195

torch.Tensor.long

Supported

196

torch.Tensor.lstsq

Unsupported

197

torch.Tensor.lt

Supported

198

torch.Tensor.lt_

Supported

199

torch.Tensor.lu

Supported

200

torch.Tensor.lu_solve

Supported

201

torch.Tensor.map_

Unsupported

202

torch.Tensor.masked_scatter_

Supported

203

torch.Tensor.masked_scatter

Supported

204

torch.Tensor.masked_fill_

Supported

205

torch.Tensor.masked_fill

Supported

206

torch.Tensor.masked_select

Supported

207

torch.Tensor.matmul

Supported

208

torch.Tensor.matrix_power

Supported

209

torch.Tensor.max

Supported

210

torch.Tensor.mean

Supported

211

torch.Tensor.median

Supported

212

torch.Tensor.min

Supported

213

torch.Tensor.mm

Supported

214

torch.Tensor.mode

Unsupported

215

torch.Tensor.mul

Supported

216

torch.Tensor.mul_

Supported

217

torch.Tensor.multinomial

Supported

218

torch.Tensor.mv

Supported

219

torch.Tensor.mvlgamma

Unsupported

220

torch.Tensor.mvlgamma_

Unsupported

221

torch.Tensor.narrow

Supported

222

torch.Tensor.narrow_copy

Supported

223

torch.Tensor.ndimension

Supported

224

torch.Tensor.ne

Supported

225

torch.Tensor.ne_

Supported

226

torch.Tensor.neg

Supported

227

torch.Tensor.neg_

Supported

228

torch.Tensor.nelement

Supported

229

torch.Tensor.nonzero

Supported

230

torch.Tensor.norm

Supported

231

torch.Tensor.normal_

Supported

232

torch.Tensor.numel

Supported

233

torch.Tensor.numpy

Unsupported

234

torch.Tensor.orgqr

Unsupported

235

torch.Tensor.ormqr

Unsupported

236

torch.Tensor.permute

Supported

237

torch.Tensor.pin_memory

Unsupported

238

torch.Tensor.pinverse

Unsupported

239

torch.Tensor.polygamma

Unsupported

240

torch.Tensor.polygamma_

Unsupported

241

torch.Tensor.pow

Supported

242

torch.Tensor.pow_

Supported

243

torch.Tensor.prod

Supported

244

torch.Tensor.put_

Supported

245

torch.Tensor.qr

Supported

246

torch.Tensor.qscheme

Unsupported

247

torch.Tensor.q_scale

Unsupported

248

torch.Tensor.q_zero_point

Unsupported

249

torch.Tensor.q_per_channel_scales

Unsupported

250

torch.Tensor.q_per_channel_zero_points

Unsupported

251

torch.Tensor.q_per_channel_axis

Unsupported

252

torch.Tensor.random_

Supported

253

torch.Tensor.reciprocal

Supported

254

torch.Tensor.reciprocal_

Supported

255

torch.Tensor.record_stream

Unsupported

256

torch.Tensor.remainder

Supported

257

torch.Tensor.remainder_

Supported

258

torch.Tensor.renorm

Supported

259

torch.Tensor.renorm_

Supported

260

torch.Tensor.repeat

Supported

261

torch.Tensor.repeat_interleave

Supported

262

torch.Tensor.requires_grad_

Supported

263

torch.Tensor.reshape

Supported

264

torch.Tensor.reshape_as

Supported

265

torch.Tensor.resize_

Supported

266

torch.Tensor.resize_as_

Supported

267

torch.Tensor.rfft

Unsupported

268

torch.Tensor.roll

Unsupported

269

torch.Tensor.rot90

Supported

270

torch.Tensor.round

Supported

271

torch.Tensor.round_

Supported

272

torch.Tensor.rsqrt

Supported

273

torch.Tensor.rsqrt_

Supported

274

torch.Tensor.scatter

Supported

275

torch.Tensor.scatter_

Supported

276

torch.Tensor.scatter_add_

Supported

277

torch.Tensor.scatter_add

Supported

278

torch.Tensor.select

Supported

279

torch.Tensor.set_

Supported

280

torch.Tensor.share_memory_

Unsupported

281

torch.Tensor.short

Supported

282

torch.Tensor.sigmoid

Supported

283

torch.Tensor.sigmoid_

Supported

284

torch.Tensor.sign

Supported

285

torch.Tensor.sign_

Supported

286

torch.Tensor.sin

Supported

287

torch.Tensor.sin_

Supported

288

torch.Tensor.sinh

Supported

289

torch.Tensor.sinh_

Supported

290

torch.Tensor.size

Supported

291

torch.Tensor.slogdet

Supported

292

torch.Tensor.solve

Unsupported

293

torch.Tensor.sort

Supported

294

torch.Tensor.split

Supported

295

torch.Tensor.sparse_mask

Unsupported

296

torch.Tensor.sparse_dim

Unsupported

297

torch.Tensor.sqrt

Supported

298

torch.Tensor.sqrt_

Supported

299

torch.Tensor.square

Supported

300

torch.Tensor.square_

Supported

301

torch.Tensor.squeeze

Supported

302

torch.Tensor.squeeze_

Supported

303

torch.Tensor.std

Supported

304

torch.Tensor.stft

Unsupported

305

torch.Tensor.storage

Supported

306

torch.Tensor.storage_offset

Supported

307

torch.Tensor.storage_type

Supported

308

torch.Tensor.stride

Supported

309

torch.Tensor.sub

Supported

310

torch.Tensor.sub_

Supported

311

torch.Tensor.sum

Supported

312

torch.Tensor.sum_to_size

Supported

313

torch.Tensor.svd

Supported

314

torch.Tensor.symeig

Supported

315

torch.Tensor.t

Supported

316

torch.Tensor.t_

Supported

317

torch.Tensor.to

Supported

318

torch.Tensor.to_mkldnn

Unsupported

319

torch.Tensor.take

Supported

320

torch.Tensor.tan

Supported

321

torch.Tensor.tan_

Supported

322

torch.Tensor.tanh

Supported

323

torch.Tensor.tanh_

Supported

324

torch.Tensor.tolist

Supported

325

torch.Tensor.topk

Supported

326

torch.Tensor.to_sparse

Unsupported

327

torch.Tensor.trace

Unsupported

328

torch.Tensor.transpose

Supported

329

torch.Tensor.transpose_

Supported

330

torch.Tensor.triangular_solve

Supported

331

torch.Tensor.tril

Supported

332

torch.Tensor.tril_

Supported

333

torch.Tensor.triu

Supported

334

torch.Tensor.triu_

Supported

335

torch.Tensor.true_divide

Supported

336

torch.Tensor.true_divide_

Supported

337

torch.Tensor.trunc

Supported

338

torch.Tensor.trunc_

Supported

339

torch.Tensor.type

Supported

340

torch.Tensor.type_as

Supported

341

torch.Tensor.unbind

Supported

342

torch.Tensor.unfold

Supported

343

torch.Tensor.uniform_

Supported

344

torch.Tensor.unique

Supported

345

torch.Tensor.unique_consecutive

Unsupported

346

torch.Tensor.unsqueeze

Supported

347

torch.Tensor.unsqueeze_

Supported

348

torch.Tensor.values

Unsupported

349

torch.Tensor.var

Unsupported

350

torch.Tensor.view

Supported

351

torch.Tensor.view_as

Supported

352

torch.Tensor.where

Supported

353

torch.Tensor.zero_

Supported

354

torch.BoolTensor

Supported

355

torch.BoolTensor.all

Supported

356

torch.BoolTensor.any

Supported

Layers (torch.nn)

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.nn.Parameter

Supported

2

torch.nn.Module

Supported

3

torch.nn.Module.add_module

Supported

4

torch.nn.Module.apply

Supported

5

torch.nn.Module.bfloat16

Unsupported

6

torch.nn.Module.buffers

Supported

7

torch.nn.Module.children

Supported

8

torch.nn.Module.cpu

Supported

9

torch.nn.Module.cuda

Unsupported

10

torch.nn.Module.double

Unsupported

11

torch.nn.Module.dump_patches

Supported

12

torch.nn.Module.eval

Supported

13

torch.nn.Module.extra_repr

Supported

14

torch.nn.Module.float

Supported

15

torch.nn.Module.forward

Supported

16

torch.nn.Module.half

Supported

17

torch.nn.Module.load_state_dict

Supported

18

torch.nn.Module.modules

Supported

19

torch.nn.Module.named_buffers

Supported

20

torch.nn.Module.named_children

Supported

21

torch.nn.Module.named_modules

Supported

22

torch.nn.Module.named_parameters

Supported

23

torch.nn.Module.parameters

Supported

24

torch.nn.Module.register_backward_hook

Supported

25

torch.nn.Module.register_buffer

Supported

26

torch.nn.Module.register_forward_hook

Supported

27

torch.nn.Module.register_forward_pre_hook

Supported

28

torch.nn.Module.register_parameter

Supported

29

torch.nn.Module.requires_grad_

Supported

30

torch.nn.Module.state_dict

Supported

31

torch.nn.Module.to

Supported

32

torch.nn.Module.train

Supported

33

torch.nn.Module.type

Supported

34

torch.nn.Module.zero_grad

Supported

35

torch.nn.Sequential

Supported

36

torch.nn.ModuleList

Supported

37

torch.nn.ModuleList.append

Supported

38

torch.nn.ModuleList.extend

Supported

39

torch.nn.ModuleList.insert

Supported

40

torch.nn.ModuleDict

Supported

41

torch.nn.ModuleDict.clear

Supported

42

torch.nn.ModuleDict.items

Supported

43

torch.nn.ModuleDict.keys

Supported

44

torch.nn.ModuleDict.pop

Supported

45

torch.nn.ModuleDict.update

Supported

46

torch.nn.ModuleDict.values

Supported

47

torch.nn.ParameterList

Supported

48

torch.nn.ParameterList.append

Supported

49

torch.nn.ParameterList.extend

Supported

50

torch.nn.ParameterDict

Supported

51

torch.nn.ParameterDict.clear

Supported

52

torch.nn.ParameterDict.items

Supported

53

torch.nn.ParameterDict.keys

Supported

54

torch.nn.ParameterDict.pop

Supported

55

torch.nn.ParameterDict.update

Supported

56

torch.nn.ParameterDict.values

Supported

57

torch.nn.Conv1d

Supported

58

torch.nn.Conv2d

Supported

59

torch.nn.Conv3d

Supported

60

torch.nn.ConvTranspose1d

Unsupported

61

torch.nn.ConvTranspose2d

Supported

62

torch.nn.ConvTranspose3d

Unsupported

63

torch.nn.Unfold

Unsupported

64

torch.nn.Fold

Supported

65

torch.nn.MaxPool1d

Supported

66

torch.nn.MaxPool2d

Supported

67

torch.nn.MaxPool3d

Supported

68

torch.nn.MaxUnpool1d

Unsupported

69

torch.nn.MaxUnpool2d

Supported

70

torch.nn.MaxUnpool3d

Supported

71

torch.nn.AvgPool1d

Supported

72

torch.nn.AvgPool2d

Supported

73

torch.nn.AvgPool3d

Supported

74

torch.nn.FractionalMaxPool2d

Unsupported

75

torch.nn.LPPool1d

Supported

76

torch.nn.LPPool2d

Supported

77

torch.nn.AdaptiveMaxPool1d

Unsupported

78

torch.nn.AdaptiveMaxPool2d

Unsupported

79

torch.nn.AdaptiveMaxPool3d

Unsupported

80

torch.nn.AdaptiveAvgPool1d

Supported

81

torch.nn.AdaptiveAvgPool2d

Supported

82

torch.nn.AdaptiveAvgPool3d

Unsupported

83

torch.nn.ReflectionPad1d

Unsupported

84

torch.nn.ReflectionPad2d

Supported

85

torch.nn.ReplicationPad1d

Unsupported

86

torch.nn.ReplicationPad2d

Supported

87

torch.nn.ReplicationPad3d

Unsupported

88

torch.nn.ZeroPad2d

Supported

89

torch.nn.ConstantPad1d

Supported

90

torch.nn.ConstantPad2d

Supported

91

torch.nn.ConstantPad3d

Supported

92

torch.nn.ELU

Supported

93

torch.nn.Hardshrink

Supported

94

torch.nn.Hardtanh

Supported

95

torch.nn.LeakyReLU

Supported

96

torch.nn.LogSigmoid

Supported

97

torch.nn.MultiheadAttention

Unsupported

98

torch.nn.PReLU

Unsupported

99

torch.nn.ReLU

Supported

100

torch.nn.ReLU6

Supported

101

torch.nn.RReLU

Unsupported

102

torch.nn.SELU

Supported

103

torch.nn.CELU

Supported

104

torch.nn.GELU

Supported

105

torch.nn.Sigmoid

Supported

106

torch.nn.Softplus

Unsupported

107

torch.nn.Softshrink

Supported. However, it is not supported in SoftShrink scenarios currently.

108

torch.nn.Softsign

Supported

109

torch.nn.Tanh

Supported

110

torch.nn.Tanhshrink

Supported

111

torch.nn.Threshold

Supported

112

torch.nn.Softmin

Supported

113

torch.nn.Softmax

Supported

114

torch.nn.Softmax2d

Supported

115

torch.nn.LogSoftmax

Unsupported

116

torch.nn.AdaptiveLogSoftmaxWithLoss

Unsupported

117

torch.nn.AdaptiveLogSoftmaxWithLoss.log_prob

Unsupported

118

torch.nn.AdaptiveLogSoftmaxWithLoss.predict

Unsupported

119

torch.nn.BatchNorm1d

Supported

120

torch.nn.BatchNorm2d

Supported

121

torch.nn.BatchNorm3d

Unsupported

122

torch.nn.GroupNorm

Supported

123

torch.nn.SyncBatchNorm

Unsupported

124

torch.nn.SyncBatchNorm.convert_sync_batchnorm

Unsupported

125

torch.nn.InstanceNorm1d

Supported

126

torch.nn.InstanceNorm2d

Supported

127

torch.nn.InstanceNorm3d

Supported

128

torch.nn.LayerNorm

Supported

129

torch.nn.LocalResponseNorm

Supported

130

torch.nn.RNNBase

Supported

131

torch.nn.RNNBase.flatten_parameters

Supported

132

torch.nn.RNN

Supported

133

torch.nn.LSTM

Supported

134

torch.nn.GRU

Supported. However, it is not supported in DynamicGRUV2 scenarios currently.

135

torch.nn.RNNCell

Supported

136

torch.nn.LSTMCell

Supported

137

torch.nn.GRUCell

Supported

138

torch.nn.Transformer

Unsupported

139

torch.nn.Transformer.forward

Unsupported

140

torch.nn.Transformer.generate_square_subsequent_mask

Unsupported

141

torch.nn.TransformerEncoder

Supported

142

torch.nn.TransformerEncoder.forward

Supported

143

torch.nn.TransformerDecoder

Unsupported

144

torch.nn.TransformerDecoder.forward

Unsupported

145

torch.nn.TransformerEncoderLayer

Supported

146

torch.nn.TransformerEncoderLayer.forward

Supported

147

torch.nn.TransformerDecoderLayer

Unsupported

148

torch.nn.TransformerDecoderLayer.forward

Unsupported

149

torch.nn.Identity

Supported

150

torch.nn.Linear

Supported

151

torch.nn.Bilinear

Supported

152

torch.nn.Dropout

Supported

153

torch.nn.Dropout2d

Supported

154

torch.nn.Dropout3d

Supported

155

torch.nn.AlphaDropout

Supported

156

torch.nn.Embedding

Supported

157

torch.nn.Embedding.from_pretrained

Supported

158

torch.nn.EmbeddingBag

Unsupported

159

torch.nn.EmbeddingBag.from_pretrained

Unsupported

160

torch.nn.CosineSimilarity

Supported

161

torch.nn.PairwiseDistance

Supported

162

torch.nn.L1Loss

Supported

163

torch.nn.MSELoss

Supported

164

torch.nn.CrossEntropyLoss

Supported

165

torch.nn.CTCLoss

Supported

166

torch.nn.NLLLoss

Supported

167

torch.nn.PoissonNLLLoss

Supported

168

torch.nn.KLDivLoss

Supported

169

torch.nn.BCELoss

Supported

170

torch.nn.BCEWithLogitsLoss

Supported

171

torch.nn.MarginRankingLoss

Supported

172

torch.nn.HingeEmbeddingLoss

Supported

173

torch.nn.MultiLabelMarginLoss

Unsupported

174

torch.nn.SmoothL1Loss

Supported

175

torch.nn.SoftMarginLoss

Unsupported

176

torch.nn.MultiLabelSoftMarginLoss

Supported

177

torch.nn.CosineEmbeddingLoss

Supported

178

torch.nn.MultiMarginLoss

Unsupported

179

torch.nn.TripletMarginLoss

Supported

180

torch.nn.PixelShuffle

Supported

181

torch.nn.Upsample

Supported

182

torch.nn.UpsamplingNearest2d

Supported

183

torch.nn.UpsamplingBilinear2d

Supported

184

torch.nn.DataParallel

Unsupported

185

torch.nn.parallel.DistributedDataParallel

Supported

186

torch.nn.parallel.DistributedDataParallel.no_sync

Supported

187

torch.nn.utils.clip_grad_norm_

Unsupported

188

torch.nn.utils.clip_grad_value_

Unsupported

189

torch.nn.utils.parameters_to_vector

Supported

190

torch.nn.utils.vector_to_parameters

Supported

197

torch.nn.utils.prune.PruningContainer

Supported

198

torch.nn.utils.prune.PruningContainer.add_pruning_method

Unsupported

199

torch.nn.utils.prune.PruningContainer.apply

Supported

200

torch.nn.utils.prune.PruningContainer.apply_mask

Unsupported

201

torch.nn.utils.prune.PruningContainer.compute_mask

Supported

202

torch.nn.utils.prune.PruningContainer.prune

Supported

203

torch.nn.utils.prune.PruningContainer.remove

Unsupported

204

torch.nn.utils.prune.Identity

Supported

205

torch.nn.utils.prune.Identity.apply

Supported

206

torch.nn.utils.prune.Identity.apply_mask

Unsupported

207

torch.nn.utils.prune.Identity.prune

Supported

208

torch.nn.utils.prune.Identity.remove

Unsupported

209

torch.nn.utils.prune.RandomUnstructured

Supported

210

torch.nn.utils.prune.RandomUnstructured.apply

Unsupported

211

torch.nn.utils.prune.RandomUnstructured.apply_mask

Unsupported

212

torch.nn.utils.prune.RandomUnstructured.prune

Unsupported

213

torch.nn.utils.prune.RandomUnstructured.remove

Unsupported

214

torch.nn.utils.prune.L1Unstructured

Supported

215

torch.nn.utils.prune.L1Unstructured.apply

Unsupported

216

torch.nn.utils.prune.L1Unstructured.apply_mask

Unsupported

217

torch.nn.utils.prune.L1Unstructured.prune

Unsupported

218

torch.nn.utils.prune.L1Unstructured.remove

Unsupported

219

torch.nn.utils.prune.RandomStructured

Supported

220

torch.nn.utils.prune.RandomStructured.apply

Supported

221

torch.nn.utils.prune.RandomStructured.apply_mask

Unsupported

222

torch.nn.utils.prune.RandomStructured.compute_mask

Supported

223

torch.nn.utils.prune.RandomStructured.prune

Supported

224

torch.nn.utils.prune.RandomStructured.remove

Unsupported

225

torch.nn.utils.prune.LnStructured

Supported

226

torch.nn.utils.prune.LnStructured.apply

Unsupported

227

torch.nn.utils.prune.LnStructured.apply_mask

Unsupported

228

torch.nn.utils.prune.LnStructured.compute_mask

Unsupported

229

torch.nn.utils.prune.LnStructured.prune

Unsupported

230

torch.nn.utils.prune.LnStructured.remove

Unsupported

231

torch.nn.utils.prune.CustomFromMask

Supported

232

torch.nn.utils.prune.CustomFromMask.apply

Supported

233

torch.nn.utils.prune.CustomFromMask.apply_mask

Unsupported

234

torch.nn.utils.prune.CustomFromMask.prune

Supported

235

torch.nn.utils.prune.CustomFromMask.remove

Unsupported

236

torch.nn.utils.prune.identity

Supported

237

torch.nn.utils.prune.random_unstructured

Unsupported

238

torch.nn.utils.prune.l1_unstructured

Unsupported

239

torch.nn.utils.prune.random_structured

Supported

240

torch.nn.utils.prune.ln_structured

Unsupported

241

torch.nn.utils.prune.global_unstructured

Unsupported

242

torch.nn.utils.prune.custom_from_mask

Supported

243

torch.nn.utils.prune.remove

Supported

244

torch.nn.utils.prune.is_pruned

Supported

245

torch.nn.utils.weight_norm

Supported

246

torch.nn.utils.remove_weight_norm

Supported

247

torch.nn.utils.spectral_norm

Supported

248

torch.nn.utils.remove_spectral_norm

Unsupported

249

torch.nn.utils.rnn.PackedSequence

Supported

250

torch.nn.utils.rnn.pack_padded_sequence

Supported

251

torch.nn.utils.rnn.pad_packed_sequence

Unsupported

252

torch.nn.utils.rnn.pad_sequence

Supported

253

torch.nn.utils.rnn.pack_sequence

Unsupported

254

torch.nn.Flatten

Supported

255

torch.quantization.quantize

Unsupported

256

torch.quantization.quantize_dynamic

Unsupported

257

torch.quantization.quantize_qat

Unsupported

258

torch.quantization.prepare

Unsupported

259

torch.quantization.prepare_qat

Unsupported

260

torch.quantization.convert

Unsupported

261

torch.quantization.QConfig

Unsupported

262

torch.quantization.QConfigDynamic

Unsupported

263

torch.quantization.fuse_modules

Unsupported

264

torch.quantization.QuantStub

Unsupported

265

torch.quantization.DeQuantStub

Unsupported

266

torch.quantization.QuantWrapper

Unsupported

267

torch.quantization.add_quant_dequant

Unsupported

268

torch.quantization.add_observer_

Unsupported

269

torch.quantization.swap_module

Unsupported

270

torch.quantization.propagate_qconfig_

Unsupported

271

torch.quantization.default_eval_fn

Unsupported

272

torch.quantization.MinMaxObserver

Unsupported

273

torch.quantization.MovingAverageMinMaxObserver

Unsupported

274

torch.quantization.PerChannelMinMaxObserver

Unsupported

275

torch.quantization.MovingAveragePerChannelMinMaxObserver

Unsupported

276

torch.quantization.HistogramObserver

Unsupported

277

torch.quantization.FakeQuantize

Unsupported

278

torch.quantization.NoopObserver

Unsupported

279

torch.quantization.get_observer_dict

Unsupported

280

torch.quantization.RecordingObserver

Unsupported

281

torch.nn.intrinsic.ConvBn2d

Supported

282

torch.nn.intrinsic.ConvBnReLU2d

Supported

283

torch.nn.intrinsic.ConvReLU2d

Supported

284

torch.nn.intrinsic.ConvReLU3d

Unsupported

285

torch.nn.intrinsic.LinearReLU

Supported

286

torch.nn.intrinsic.qat.ConvBn2d

Unsupported

287

torch.nn.intrinsic.qat.ConvBnReLU2d

Unsupported

288

torch.nn.intrinsic.qat.ConvReLU2d

Unsupported

289

torch.nn.intrinsic.qat.LinearReLU

Unsupported

290

torch.nn.intrinsic.quantized.ConvReLU2d

Unsupported

291

torch.nn.intrinsic.quantized.ConvReLU3d

Unsupported

292

torch.nn.intrinsic.quantized.LinearReLU

Unsupported

293

torch.nn.qat.Conv2d

Unsupported

294

torch.nn.qat.Conv2d.from_float

Unsupported

295

torch.nn.qat.Linear

Unsupported

296

torch.nn.qat.Linear.from_float

Unsupported

297

torch.nn.quantized.functional.relu

Unsupported

298

torch.nn.quantized.functional.linear

Unsupported

299

torch.nn.quantized.functional.conv2d

Unsupported

300

torch.nn.quantized.functional.conv3d

Unsupported

301

torch.nn.quantized.functional.max_pool2d

Unsupported

302

torch.nn.quantized.functional.adaptive_avg_pool2d

Unsupported

303

torch.nn.quantized.functional.avg_pool2d

Unsupported

304

torch.nn.quantized.functional.interpolate

Unsupported

305

torch.nn.quantized.functional.upsample

Unsupported

306

torch.nn.quantized.functional.upsample_bilinear

Unsupported

307

torch.nn.quantized.functional.upsample_nearest

Unsupported

308

torch.nn.quantized.ReLU

Unsupported

309

torch.nn.quantized.ReLU6

Unsupported

310

torch.nn.quantized.Conv2d

Unsupported

311

torch.nn.quantized.Conv2d.from_float

Unsupported

312

torch.nn.quantized.Conv3d

Unsupported

313

torch.nn.quantized.Conv3d.from_float

Unsupported

314

torch.nn.quantized.FloatFunctional

Unsupported

315

torch.nn.quantized.QFunctional

Unsupported

316

torch.nn.quantized.Quantize

Unsupported

317

torch.nn.quantized.DeQuantize

Unsupported

318

torch.nn.quantized.Linear

Unsupported

319

torch.nn.quantized.Linear.from_float

Unsupported

320

torch.nn.quantized.dynamic.Linear

Unsupported

321

torch.nn.quantized.dynamic.Linear.from_float

Unsupported

322

torch.nn.quantized.dynamic.LSTM

Unsupported

Functions(torch.nn.functional)

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.nn.functional.conv1d

Supported

2

torch.nn.functional.conv2d

Supported

3

torch.nn.functional.conv3d

Supported

4

torch.nn.functional.conv_transpose1d

Supported

5

torch.nn.functional.conv_transpose2d

Supported

6

torch.nn.functional.conv_transpose3d

Unsupported

7

torch.nn.functional.unfold

Unsupported

8

torch.nn.functional.fold

Supported

9

torch.nn.functional.avg_pool1d

Supported

10

torch.nn.functional.avg_pool2d

Supported

11

torch.nn.functional.avg_pool3d

Supported

12

torch.nn.functional.max_pool1d

Supported

13

torch.nn.functional.max_pool2d

Supported

14

torch.nn.functional.max_pool3d

Supported

15

torch.nn.functional.max_unpool1d

Unsupported

16

torch.nn.functional.max_unpool2d

Unsupported

17

torch.nn.functional.max_unpool3d

Unsupported

18

torch.nn.functional.lp_pool1d

Supported

19

torch.nn.functional.lp_pool2d

Supported

20

torch.nn.functional.adaptive_max_pool1d

Supported

21

torch.nn.functional.adaptive_max_pool2d

Supported

22

torch.nn.functional.adaptive_max_pool3d

Unsupported

23

torch.nn.functional.adaptive_avg_pool1d

Supported

24

torch.nn.functional.adaptive_avg_pool2d

Supported

25

torch.nn.functional.adaptive_avg_pool3d

Supported

26

torch.nn.functional.threshold

Supported

27

torch.nn.functional.threshold_

Supported

28

torch.nn.functional.relu

Supported

29

torch.nn.functional.relu_

Supported

30

torch.nn.functional.hardtanh

Supported

31

torch.nn.functional.hardtanh_

Supported

32

torch.nn.functional.relu6

Supported

33

torch.nn.functional.elu

Supported

34

torch.nn.functional.elu_

Supported

35

torch.nn.functional.selu

Supported

36

torch.nn.functional.celu

Supported

37

torch.nn.functional.leaky_relu

Supported

38

torch.nn.functional.leaky_relu_

Supported

39

torch.nn.functional.prelu

Supported

40

torch.nn.functional.rrelu

Unsupported

41

torch.nn.functional.rrelu_

Unsupported

42

torch.nn.functional.glu

Supported

43

torch.nn.functional.gelu

Supported

44

torch.nn.functional.logsigmoid

Supported

45

torch.nn.functional.hardshrink

Supported

46

torch.nn.functional.tanhshrink

Supported

47

torch.nn.functional.softsign

Supported

48

torch.nn.functional.softplus

Supported

49

torch.nn.functional.softmin

Supported

50

torch.nn.functional.softmax

Supported

51

torch.nn.functional.softshrink

Unsupported

52

torch.nn.functional.gumbel_softmax

Unsupported

53

torch.nn.functional.log_softmax

Supported

54

torch.nn.functional.tanh

Supported

55

torch.nn.functional.sigmoid

Supported

56

torch.nn.functional.batch_norm

Supported

57

torch.nn.functional.instance_norm

Supported

58

torch.nn.functional.layer_norm

Supported

59

torch.nn.functional.local_response_norm

Supported

60

torch.nn.functional.normalize

Supported

61

torch.nn.functional.linear

Supported

62

torch.nn.functional.bilinear

Supported

63

torch.nn.functional.dropout

Supported

64

torch.nn.functional.alpha_dropout

Supported

65

torch.nn.functional.dropout2d

Unsupported

66

torch.nn.functional.dropout3d

Unsupported

67

torch.nn.functional.embedding

Supported

68

torch.nn.functional.embedding_bag

Unsupported

69

torch.nn.functional.one_hot

Supported

70

torch.nn.functional.pairwise_distance

Supported

71

torch.nn.functional.cosine_similarity

Supported

72

torch.nn.functional.pdist

Supported

73

torch.nn.functional.binary_cross_entropy

Supported

74

torch.nn.functional.binary_cross_entropy_with_logits

Supported

75

torch.nn.functional.poisson_nll_loss

Supported

76

torch.nn.functional.cosine_embedding_loss

Supported

77

torch.nn.functional.cross_entropy

Supported

78

torch.nn.functional.ctc_loss

Supported

79

torch.nn.functional.hinge_embedding_loss

Supported

80

torch.nn.functional.kl_div

Supported

81

torch.nn.functional.l1_loss

Supported

82

torch.nn.functional.mse_loss

Supported

83

torch.nn.functional.margin_ranking_loss

Supported

84

torch.nn.functional.multilabel_margin_loss

Supported

85

torch.nn.functional.multilabel_soft_margin_loss

Supported

86

torch.nn.functional.multi_margin_loss

Unsupported

87

torch.nn.functional.nll_loss

Supported

88

torch.nn.functional.smooth_l1_loss

Supported

89

torch.nn.functional.soft_margin_loss

Supported

90

torch.nn.functional.triplet_margin_loss

Supported

91

torch.nn.functional.pixel_shuffle

Supported

92

torch.nn.functional.pad

Supported

93

torch.nn.functional.interpolate

Unsupported

94

torch.nn.functional.upsample

Unsupported

95

torch.nn.functional.upsample_nearest

Unsupported

96

torch.nn.functional.upsample_bilinear

Supported

97

torch.nn.functional.grid_sample

Supported

98

torch.nn.functional.affine_grid

Unsupported

99

torch.nn.parallel.data_parallel

Unsupported

torch.distributed

No.

API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.distributed.init_process_group

Supported

2

torch.distributed.Backend

Supported

3

torch.distributed.get_backend

Supported

4

torch.distributed.get_rank

Supported

5

torch.distributed.get_world_size

Supported

6

torch.distributed.is_initialized

Supported

7

torch.distributed.is_mpi_available

Supported

8

torch.distributed.is_nccl_available

Supported

9

torch.distributed.new_group

Supported

10

torch.distributed.send

Unsupported

11

torch.distributed.recv

Unsupported

12

torch.distributed.isend

Unsupported

13

torch.distributed.irecv

Unsupported

14

is_completed

Supported

15

wait

Supported

16

torch.distributed.broadcast

Supported

17

torch.distributed.all_reduce

Supported

18

torch.distributed.reduce

Unsupported

19

torch.distributed.all_gather

Supported

20

torch.distributed.gather

Supported

21

torch.distributed.scatter

Supported

22

torch.distributed.barrier

Supported

23

torch.distributed.ReduceOp

Supported

24

torch.distributed.reduce_op

Supported

25

torch.distributed.broadcast_multigpu

Unsupported

26

torch.distributed.all_reduce_multigpu

Unsupported

27

torch.distributed.reduce_multigpu

Unsupported

28

torch.distributed.all_gather_multigpu

Unsupported

29

torch.distributed.launch

Supported

30

torch.multiprocessing.spawn

Supported

NPU and CUDA Function Alignment

No.

CUDA API Name

NPU API Name

Supported/Unsupported (PyTorch 1.5.0)

1

torch.cuda.current_blas_handle

torch.npu.current_blas_handle

Unsupported

2

torch.cuda.current_device

torch.npu.current_device

Supported

3

torch.cuda.current_stream

torch.npu.current_stream

Supported

4

torch.cuda.default_stream

torch.npu.default_stream

Supported

5

torch.cuda.device

torch.npu.device

Unsupported

6

torch.cuda.device_count

torch.npu.device_count

Supported

7

torch.cuda.device_of

torch.npu.device_of

Unsupported

8

torch.cuda.get_device_capability

torch.npu.get_device_capability

Unsupported

9

torch.cuda.get_device_name

torch.npu.get_device_name

Unsupported

10

torch.cuda.init

torch.npu.init

Supported

11

torch.cuda.ipc_collect

torch.npu.ipc_collect

Unsupported

12

torch.cuda.is_available

torch.npu.is_available

Supported

13

torch.cuda.is_initialized

torch.npu.is_initialized

Supported

14

torch.cuda.set_device

torch.npu.set_device

Partially supported

15

torch.cuda.stream

torch.npu.stream

Supported

16

torch.cuda.synchronize

torch.npu.synchronize

Supported

17

torch.cuda.get_rng_state

torch.npu.get_rng_state

Unsupported

18

torch.cuda.get_rng_state_all

torch.npu.get_rng_state_all

Unsupported

19

torch.cuda.set_rng_state

torch.npu.set_rng_state

Unsupported

20

torch.cuda.set_rng_state_all

torch.npu.set_rng_state_all

Unsupported

21

torch.cuda.manual_seed

torch.npu.manual_seed

Unsupported

22

torch.cuda.manual_seed_all

torch.npu.manual_seed_all

Unsupported

23

torch.cuda.seed

torch.npu.seed

Unsupported

24

torch.cuda.seed_all

torch.npu.seed_all

Unsupported

25

torch.cuda.initial_seed

torch.npu.initial_seed

Unsupported

26

torch.cuda.comm.broadcast

torch.npu.comm.broadcast

Unsupported

27

torch.cuda.comm.broadcast_coalesced

torch.npu.comm.broadcast_coalesced

Unsupported

28

torch.cuda.comm.reduce_add

torch.npu.comm.reduce_add

Unsupported

29

torch.cuda.comm.scatter

torch.npu.comm.scatter

Unsupported

30

torch.cuda.comm.gather

torch.npu.comm.gather

Unsupported

31

torch.cuda.Stream

torch.npu.Stream

Supported

32

torch.cuda.Stream.query

torch.npu.Stream.query

Unsupported

33

torch.cuda.Stream.record_event

torch.npu.Stream.record_event

Supported

34

torch.cuda.Stream.synchronize

torch.npu.Stream.synchronize

Supported

35

torch.cuda.Stream.wait_event

torch.npu.Stream.wait_event

Supported

36

torch.cuda.Stream.wait_stream

torch.npu.Stream.wait_stream

Supported

37

torch.cuda.Event

torch.npu.Event

Supported

38

torch.cuda.Event.elapsed_time

torch.npu.Event.elapsed_time

Supported

39

torch.cuda.Event.from_ipc_handle

torch.npu.Event.from_ipc_handle

Unsupported

40

torch.cuda.Event.ipc_handle

torch.npu.Event.ipc_handle

Unsupported

41

torch.cuda.Event.query

torch.npu.Event.query

Supported

42

torch.cuda.Event.record

torch.npu.Event.record

Supported

43

torch.cuda.Event.synchronize

torch.npu.Event.synchronize

Supported

44

torch.cuda.Event.wait

torch.npu.Event.wait

Supported

45

torch.cuda.empty_cache

torch.npu.empty_cache

Supported

46

torch.cuda.memory_stats

torch.npu.memory_stats

Supported

47

torch.cuda.memory_summary

torch.npu.memory_summary

Supported

48

torch.cuda.memory_snapshot

torch.npu.memory_snapshot

Supported

49

torch.cuda.memory_allocated

torch.npu.memory_allocated

Supported

50

torch.cuda.max_memory_allocated

torch.npu.max_memory_allocated

Supported

51

torch.cuda.reset_max_memory_allocated

torch.npu.reset_max_memory_allocated

Supported

52

torch.cuda.memory_reserved

torch.npu.memory_reserved

Supported

53

torch.cuda.max_memory_reserved

torch.npu.max_memory_reserved

Supported

54

torch.cuda.memory_cached

torch.npu.memory_cached

Supported

55

torch.cuda.max_memory_cached

torch.npu.max_memory_cached

Supported

56

torch.cuda.reset_max_memory_cached

torch.npu.reset_max_memory_cached

Supported

57

torch.cuda.nvtx.mark

torch.npu.nvtx.mark

Unsupported

58

torch.cuda.nvtx.range_push

torch.npu.nvtx.range_push

Unsupported

59

torch.cuda.nvtx.range_pop

torch.npu.nvtx.range_pop

Unsupported

60

torch.cuda._sleep

torch.npu._sleep

Unsupported

61

torch.cuda.Stream.priority_range

torch.npu.Stream.priority_range

Unsupported

62

torch.cuda.get_device_properties

torch.npu.get_device_properties

Unsupported

63

torch.cuda.amp.GradScaler

torch.npu.amp.GradScaler

Unsupported

>![](public_sys-resources/icon-note.gif) **NOTE:** >The** torch.npu.set\_device \(\)** API can be used to specify the device only at the starting position of the program by using **set\_device**. The device cannot be specified for multiple times or switched by using **torch.npu.device \(id\)**.