爆款云主机2核4G限时秒杀,88元/年起!
查看详情

活动

天翼云最新优惠活动,涵盖免费试用,产品折扣等,助您降本增效!
热门活动
  • 618智算钜惠季 爆款云主机2核4G限时秒杀,88元/年起!
  • 免费体验DeepSeek,上天翼云息壤 NEW 新老用户均可免费体验2500万Tokens,限时两周
  • 云上钜惠 HOT 爆款云主机全场特惠,更有万元锦鲤券等你来领!
  • 算力套餐 HOT 让算力触手可及
  • 天翼云脑AOne NEW 连接、保护、办公,All-in-One!
  • 中小企业应用上云专场 产品组合下单即享折上9折起,助力企业快速上云
  • 息壤高校钜惠活动 NEW 天翼云息壤杯高校AI大赛,数款产品享受线上订购超值特惠
  • 天翼云电脑专场 HOT 移动办公新选择,爆款4核8G畅享1年3.5折起,快来抢购!
  • 天翼云奖励推广计划 加入成为云推官,推荐新用户注册下单得现金奖励
免费活动
  • 免费试用中心 HOT 多款云产品免费试用,快来开启云上之旅
  • 天翼云用户体验官 NEW 您的洞察,重塑科技边界

智算服务

打造统一的产品能力,实现算网调度、训练推理、技术架构、资源管理一体化智算服务
智算云(DeepSeek专区)
科研助手
  • 算力商城
  • 应用商城
  • 开发机
  • 并行计算
算力互联调度平台
  • 应用市场
  • 算力市场
  • 算力调度推荐
一站式智算服务平台
  • 模型广场
  • 体验中心
  • 服务接入
智算一体机
  • 智算一体机
大模型
  • DeepSeek-R1-昇腾版(671B)
  • DeepSeek-R1-英伟达版(671B)
  • DeepSeek-V3-昇腾版(671B)
  • DeepSeek-R1-Distill-Llama-70B
  • DeepSeek-R1-Distill-Qwen-32B
  • Qwen2-72B-Instruct
  • StableDiffusion-V2.1
  • TeleChat-12B

应用商城

天翼云精选行业优秀合作伙伴及千余款商品,提供一站式云上应用服务
进入甄选商城进入云市场创新解决方案
办公协同
  • WPS云文档
  • 安全邮箱
  • EMM手机管家
  • 智能商业平台
财务管理
  • 工资条
  • 税务风控云
企业应用
  • 翼信息化运维服务
  • 翼视频云归档解决方案
工业能源
  • 智慧工厂_生产流程管理解决方案
  • 智慧工地
建站工具
  • SSL证书
  • 新域名服务
网络工具
  • 翼云加速
灾备迁移
  • 云管家2.0
  • 翼备份
资源管理
  • 全栈混合云敏捷版(软件)
  • 全栈混合云敏捷版(一体机)
行业应用
  • 翼电子教室
  • 翼智慧显示一体化解决方案

合作伙伴

天翼云携手合作伙伴,共创云上生态,合作共赢
天翼云生态合作中心
  • 天翼云生态合作中心
天翼云渠道合作伙伴
  • 天翼云代理渠道合作伙伴
天翼云服务合作伙伴
  • 天翼云集成商交付能力认证
天翼云应用合作伙伴
  • 天翼云云市场合作伙伴
  • 天翼云甄选商城合作伙伴
天翼云技术合作伙伴
  • 天翼云OpenAPI中心
  • 天翼云EasyCoding平台
天翼云培训认证
  • 天翼云学堂
  • 天翼云市场商学院
天翼云合作计划
  • 云汇计划
天翼云东升计划
  • 适配中心
  • 东升计划
  • 适配互认证

开发者

开发者相关功能入口汇聚
技术社区
  • 专栏文章
  • 互动问答
  • 技术视频
资源与工具
  • OpenAPI中心
开放能力
  • EasyCoding敏捷开发平台
培训与认证
  • 天翼云学堂
  • 天翼云认证
魔乐社区
  • 魔乐社区

支持与服务

为您提供全方位支持与服务,全流程技术保障,助您轻松上云,安全无忧
文档与工具
  • 文档中心
  • 新手上云
  • 自助服务
  • OpenAPI中心
定价
  • 价格计算器
  • 定价策略
基础服务
  • 售前咨询
  • 在线支持
  • 在线支持
  • 工单服务
  • 建议与反馈
  • 用户体验官
  • 服务保障
  • 客户公告
  • 会员中心
增值服务
  • 红心服务
  • 首保服务
  • 客户支持计划
  • 专家技术服务
  • 备案管家

了解天翼云

天翼云秉承央企使命,致力于成为数字经济主力军,投身科技强国伟大事业,为用户提供安全、普惠云服务
品牌介绍
  • 关于天翼云
  • 智算云
  • 天翼云4.0
  • 新闻资讯
  • 天翼云APP
基础设施
  • 全球基础设施
  • 信任中心
最佳实践
  • 精选案例
  • 超级探访
  • 云杂志
  • 分析师和白皮书
  • 天翼云·创新直播间
市场活动
  • 2025智能云生态大会
  • 2024智算云生态大会
  • 2023云生态大会
  • 2022云生态大会
  • 天翼云中国行
天翼云
  • 活动
  • 智算服务
  • 产品
  • 解决方案
  • 应用商城
  • 合作伙伴
  • 开发者
  • 支持与服务
  • 了解天翼云
      • 文档
      • 控制中心
      • 备案
      • 管理中心

      查看torch中的所有函数、方法名

      首页 知识中心 其他 文章详情页

      查看torch中的所有函数、方法名

      2023-05-09 06:05:41 阅读次数:495

      python,pytorch

      查看torch中的所有函数、方法名
      运行程序,就可以看到所有的函数、方法

      import torch
      s = dir(torch)
      for i in s:
          print(i)
      
      

      输出有一千多个结果

      AVG
      AggregationType
      AnyType
      Argument
      ArgumentSpec
      BFloat16Storage
      BFloat16Tensor
      BenchmarkConfig
      BenchmarkExecutionStats
      Block
      BoolStorage
      BoolTensor
      BoolType
      BufferDict
      ByteStorage
      ByteTensor
      CONV_BN_FUSION
      CallStack
      Capsule
      CharStorage
      CharTensor
      ClassType
      Code
      CompilationUnit
      CompleteArgumentSpec
      ComplexDoubleStorage
      ComplexFloatStorage
      ComplexType
      ConcreteModuleType
      ConcreteModuleTypeBuilder
      CudaBFloat16StorageBase
      CudaBoolStorageBase
      CudaByteStorageBase
      CudaCharStorageBase
      CudaComplexDoubleStorageBase
      CudaComplexFloatStorageBase
      CudaDoubleStorageBase
      CudaFloatStorageBase
      CudaHalfStorageBase
      CudaIntStorageBase
      CudaLongStorageBase
      CudaShortStorageBase
      DeepCopyMemoTable
      DeviceObjType
      DictType
      DisableTorchFunction
      DoubleStorage
      DoubleTensor
      EnumType
      ErrorReport
      ExecutionPlan
      FUSE_ADD_RELU
      FatalError
      FileCheck
      FloatStorage
      FloatTensor
      FloatType
      FunctionSchema
      Future
      FutureType
      Generator
      Gradient
      Graph
      GraphExecutorState
      HOIST_CONV_PACKED_PARAMS
      HalfStorage
      HalfStorageBase
      HalfTensor
      INSERT_FOLD_PREPACK_OPS
      IODescriptor
      InferredType
      IntStorage
      IntTensor
      IntType
      InterfaceType
      JITException
      ListType
      LiteScriptModule
      LockingLogger
      LoggerBase
      LongStorage
      LongTensor
      MobileOptimizerType
      ModuleDict
      Node
      NoneType
      NoopLogger
      NumberType
      OptionalType
      ParameterDict
      PyObjectType
      PyTorchFileReader
      PyTorchFileWriter
      QInt32Storage
      QInt32StorageBase
      QInt8Storage
      QInt8StorageBase
      QUInt4x2Storage
      QUInt8Storage
      REMOVE_DROPOUT
      RRefType
      SUM
      ScriptClass
      ScriptFunction
      ScriptMethod
      ScriptModule
      ScriptObject
      Set
      ShortStorage
      ShortTensor
      Size
      StaticRuntime
      Storage
      Stream
      StreamObjType
      StringType
      TYPE_CHECKING
      Tensor
      TensorType
      ThroughputBenchmark
      TracingState
      TupleType
      Type
      USE_GLOBAL_DEPS
      USE_RTLD_GLOBAL_WITH_LIBTORCH
      Use
      Value
      _C
      _StorageBase
      _VF
      __all__
      __annotations__
      __builtins__
      __cached__
      __config__
      __doc__
      __file__
      __future__
      __loader__
      __name__
      __package__
      __path__
      __spec__
      __version__
      _adaptive_avg_pool2d
      _add_batch_dim
      _add_relu
      _add_relu_
      _addmv_impl_
      _aminmax
      _amp_foreach_non_finite_check_and_unscale_
      _amp_update_scale
      _assert
      _autograd_functions
      _baddbmm_mkl_
      _batch_norm_impl_index
      _bmm
      _cast_Byte
      _cast_Char
      _cast_Double
      _cast_Float
      _cast_Half
      _cast_Int
      _cast_Long
      _cast_Short
      _cat
      _choose_qparams_per_tensor
      _classes
      _compute_linear_combination
      _conj
      _convolution
      _convolution_nogroup
      _copy_from
      _ctc_loss
      _cudnn_ctc_loss
      _cudnn_init_dropout_state
      _cudnn_rnn
      _cudnn_rnn_flatten_weight
      _cufft_clear_plan_cache
      _cufft_get_plan_cache_max_size
      _cufft_get_plan_cache_size
      _cufft_set_plan_cache_max_size
      _cummax_helper
      _cummin_helper
      _debug_has_internal_overlap
      _dim_arange
      _dirichlet_grad
      _embedding_bag
      _embedding_bag_forward_only
      _empty_affine_quantized
      _empty_per_channel_affine_quantized
      _euclidean_dist
      _fake_quantize_learnable_per_channel_affine
      _fake_quantize_learnable_per_tensor_affine
      _fft_c2c
      _fft_c2r
      _fft_r2c
      _foreach_abs
      _foreach_abs_
      _foreach_acos
      _foreach_acos_
      _foreach_add
      _foreach_add_
      _foreach_addcdiv
      _foreach_addcdiv_
      _foreach_addcmul
      _foreach_addcmul_
      _foreach_asin
      _foreach_asin_
      _foreach_atan
      _foreach_atan_
      _foreach_ceil
      _foreach_ceil_
      _foreach_cos
      _foreach_cos_
      _foreach_cosh
      _foreach_cosh_
      _foreach_div
      _foreach_div_
      _foreach_erf
      _foreach_erf_
      _foreach_erfc
      _foreach_erfc_
      _foreach_exp
      _foreach_exp_
      _foreach_expm1
      _foreach_expm1_
      _foreach_floor
      _foreach_floor_
      _foreach_frac
      _foreach_frac_
      _foreach_lgamma
      _foreach_lgamma_
      _foreach_log
      _foreach_log10
      _foreach_log10_
      _foreach_log1p
      _foreach_log1p_
      _foreach_log2
      _foreach_log2_
      _foreach_log_
      _foreach_maximum
      _foreach_minimum
      _foreach_mul
      _foreach_mul_
      _foreach_neg
      _foreach_neg_
      _foreach_reciprocal
      _foreach_reciprocal_
      _foreach_round
      _foreach_round_
      _foreach_sigmoid
      _foreach_sigmoid_
      _foreach_sin
      _foreach_sin_
      _foreach_sinh
      _foreach_sinh_
      _foreach_sqrt
      _foreach_sqrt_
      _foreach_sub
      _foreach_sub_
      _foreach_tan
      _foreach_tan_
      _foreach_tanh
      _foreach_tanh_
      _foreach_trunc
      _foreach_trunc_
      _foreach_zero_
      _fused_dropout
      _grid_sampler_2d_cpu_fallback
      _has_compatible_shallow_copy_type
      _import_dotted_name
      _index_copy_
      _index_put_impl_
      _initExtension
      _jit_internal
      _linalg_inv_out_helper_
      _linalg_qr_helper
      _linalg_solve_out_helper_
      _linalg_utils
      _load_global_deps
      _lobpcg
      _log_softmax
      _log_softmax_backward_data
      _logcumsumexp
      _lowrank
      _lu_solve_helper
      _lu_with_info
      _make_dual
      _make_per_channel_quantized_tensor
      _make_per_tensor_quantized_tensor
      _masked_scale
      _mkldnn
      _mkldnn_reshape
      _mkldnn_transpose
      _mkldnn_transpose_
      _mode
      _namedtensor_internals
      _nnpack_available
      _nnpack_spatial_convolution
      _ops
      _pack_padded_sequence
      _pad_packed_sequence
      _remove_batch_dim
      _reshape_from_tensor
      _rowwise_prune
      _s_where
      _sample_dirichlet
      _saturate_weight_to_fp16
      _shape_as_tensor
      _six
      _sobol_engine_draw
      _sobol_engine_ff_
      _sobol_engine_initialize_state_
      _sobol_engine_scramble_
      _softmax
      _softmax_backward_data
      _sparse_addmm
      _sparse_coo_tensor_unsafe
      _sparse_log_softmax
      _sparse_log_softmax_backward_data
      _sparse_matrix_mask_helper
      _sparse_mm
      _sparse_softmax
      _sparse_softmax_backward_data
      _sparse_sparse_matmul
      _sparse_sum
      _stack
      _standard_gamma
      _standard_gamma_grad
      _std
      _storage_classes
      _string_classes
      _syevd_helper
      _tensor_classes
      _tensor_str
      _test_serialization_subcmul
      _trilinear
      _unique
      _unique2
      _unpack_dual
      _use_cudnn_ctc_loss
      _use_cudnn_rnn_flatten_weight
      _utils
      _utils_internal
      _validate_sparse_coo_tensor_args
      _var
      _vmap_internals
      _weight_norm
      _weight_norm_cuda_interface
      abs
      abs_
      absolute
      acos
      acos_
      acosh
      acosh_
      adaptive_avg_pool1d
      adaptive_max_pool1d
      add
      addbmm
      addcdiv
      addcmul
      addmm
      addmv
      addmv_
      addr
      affine_grid_generator
      align_tensors
      all
      allclose
      alpha_dropout
      alpha_dropout_
      amax
      amin
      angle
      any
      arange
      arccos
      arccos_
      arccosh
      arccosh_
      arcsin
      arcsin_
      arcsinh
      arcsinh_
      arctan
      arctan_
      arctanh
      arctanh_
      are_deterministic_algorithms_enabled
      argmax
      argmin
      argsort
      as_strided
      as_strided_
      as_tensor
      asin
      asin_
      asinh
      asinh_
      atan
      atan2
      atan_
      atanh
      atanh_
      atleast_1d
      atleast_2d
      atleast_3d
      autocast_decrement_nesting
      autocast_increment_nesting
      autograd
      avg_pool1d
      backends
      baddbmm
      bartlett_window
      base_py_dll_path
      batch_norm
      batch_norm_backward_elemt
      batch_norm_backward_reduce
      batch_norm_elemt
      batch_norm_gather_stats
      batch_norm_gather_stats_with_counts
      batch_norm_stats
      batch_norm_update_stats
      bernoulli
      bfloat16
      bilinear
      binary_cross_entropy_with_logits
      bincount
      binomial
      bitwise_and
      bitwise_not
      bitwise_or
      bitwise_xor
      blackman_window
      block_diag
      bmm
      bool
      broadcast_shapes
      broadcast_tensors
      broadcast_to
      bucketize
      can_cast
      cartesian_prod
      cat
      cdist
      cdouble
      ceil
      ceil_
      celu
      celu_
      cfloat
      chain_matmul
      channel_shuffle
      channels_last
      channels_last_3d
      cholesky
      cholesky_inverse
      cholesky_solve
      choose_qparams_optimized
      chunk
      clamp
      clamp_
      clamp_max
      clamp_max_
      clamp_min
      clamp_min_
      classes
      clear_autocast_cache
      clip
      clip_
      clone
      column_stack
      combinations
      compiled_with_cxx11_abi
      complex
      complex128
      complex32
      complex64
      conj
      constant_pad_nd
      contiguous_format
      conv1d
      conv2d
      conv3d
      conv_tbc
      conv_transpose1d
      conv_transpose2d
      conv_transpose3d
      convolution
      copysign
      cos
      cos_
      cosh
      cosh_
      cosine_embedding_loss
      cosine_similarity
      count_nonzero
      cpp
      cross
      ctc_loss
      ctypes
      cuda
      cuda_path
      cuda_version
      cudnn_affine_grid_generator
      cudnn_batch_norm
      cudnn_convolution
      cudnn_convolution_transpose
      cudnn_grid_sampler
      cudnn_is_acceptable
      cummax
      cummin
      cumprod
      cumsum
      default_generator
      deg2rad
      deg2rad_
      dequantize
      det
      detach
      detach_
      device
      diag
      diag_embed
      diagflat
      diagonal
      diff
      digamma
      dist
      distributed
      distributions
      div
      divide
      dll
      dll_path
      dll_paths
      dlls
      dot
      double
      dropout
      dropout_
      dsmm
      dstack
      dtype
      eig
      einsum
      embedding
      embedding_bag
      embedding_renorm_
      empty
      empty_like
      empty_meta
      empty_quantized
      empty_strided
      enable_grad
      eq
      equal
      erf
      erf_
      erfc
      erfc_
      erfinv
      exp
      exp2
      exp2_
      exp_
      expm1
      expm1_
      eye
      fake_quantize_per_channel_affine
      fake_quantize_per_tensor_affine
      fbgemm_linear_fp16_weight
      fbgemm_linear_fp16_weight_fp32_activation
      fbgemm_linear_int8_weight
      fbgemm_linear_int8_weight_fp32_activation
      fbgemm_linear_quantize_weight
      fbgemm_pack_gemm_matrix_fp16
      fbgemm_pack_quantized_matrix
      feature_alpha_dropout
      feature_alpha_dropout_
      feature_dropout
      feature_dropout_
      fft
      fill_
      finfo
      fix
      fix_
      flatten
      flip
      fliplr
      flipud
      float
      float16
      float32
      float64
      float_power
      floor
      floor_
      floor_divide
      fmax
      fmin
      fmod
      fork
      frac
      frac_
      frobenius_norm
      from_file
      from_numpy
      full
      full_like
      functional
      futures
      gather
      gcd
      gcd_
      ge
      geqrf
      ger
      get_default_dtype
      get_device
      get_file_path
      get_num_interop_threads
      get_num_threads
      get_rng_state
      glob
      greater
      greater_equal
      grid_sampler
      grid_sampler_2d
      grid_sampler_3d
      group_norm
      gru
      gru_cell
      gt
      half
      hamming_window
      hann_window
      hardshrink
      has_cuda
      has_cudnn
      has_lapack
      has_mkl
      has_mkldnn
      has_openmp
      heaviside
      hinge_embedding_loss
      histc
      hsmm
      hspmm
      hstack
      hub
      hypot
      i0
      i0_
      igamma
      igammac
      iinfo
      imag
      import_ir_module
      import_ir_module_from_buffer
      index_add
      index_copy
      index_fill
      index_put
      index_put_
      index_select
      init_num_threads
      initial_seed
      inner
      instance_norm
      int
      int16
      int32
      int64
      int8
      int_repr
      inverse
      is_anomaly_enabled
      is_autocast_enabled
      is_complex
      is_deterministic
      is_distributed
      is_floating_point
      is_grad_enabled
      is_loaded
      is_nonzero
      is_same_size
      is_signed
      is_storage
      is_tensor
      is_vulkan_available
      isclose
      isfinite
      isinf
      isnan
      isneginf
      isposinf
      isreal
      istft
      jit
      kaiser_window
      kernel32
      kl_div
      kron
      kthvalue
      last_error
      layer_norm
      layout
      lcm
      lcm_
      ldexp
      ldexp_
      le
      legacy_contiguous_format
      lerp
      less
      less_equal
      lgamma
      linalg
      linspace
      load
      lobpcg
      log
      log10
      log10_
      log1p
      log1p_
      log2
      log2_
      log_
      log_softmax
      logaddexp
      logaddexp2
      logcumsumexp
      logdet
      logical_and
      logical_not
      logical_or
      logical_xor
      logit
      logit_
      logspace
      logsumexp
      long
      lstm
      lstm_cell
      lstsq
      lt
      lu
      lu_solve
      lu_unpack
      manual_seed
      margin_ranking_loss
      masked_fill
      masked_scatter
      masked_select
      matmul
      matrix_exp
      matrix_power
      matrix_rank
      max
      max_pool1d
      max_pool1d_with_indices
      max_pool2d
      max_pool3d
      maximum
      mean
      median
      memory_format
      merge_type_from_type_comment
      meshgrid
      min
      minimum
      miopen_batch_norm
      miopen_convolution
      miopen_convolution_transpose
      miopen_depthwise_convolution
      miopen_rnn
      mkldnn_adaptive_avg_pool2d
      mkldnn_convolution
      mkldnn_convolution_backward_weights
      mkldnn_linear_backward_weights
      mkldnn_max_pool2d
      mkldnn_max_pool3d
      mm
      mode
      moveaxis
      movedim
      msort
      mul
      multinomial
      multiply
      multiprocessing
      mv
      mvlgamma
      name
      nan_to_num
      nan_to_num_
      nanmedian
      nanquantile
      nansum
      narrow
      narrow_copy
      native_batch_norm
      native_group_norm
      native_layer_norm
      native_norm
      ne
      neg
      neg_
      negative
      negative_
      nextafter
      nn
      no_grad
      nonzero
      norm
      norm_except_dim
      normal
      not_equal
      nuclear_norm
      numel
      nvtoolsext_dll_path
      ones
      ones_like
      onnx
      ops
      optim
      orgqr
      ormqr
      os
      outer
      overrides
      pairwise_distance
      parse_ir
      parse_schema
      parse_type_comment
      path_patched
      pca_lowrank
      pdist
      per_channel_affine
      per_channel_affine_float_qparams
      per_channel_symmetric
      per_tensor_affine
      per_tensor_symmetric
      pfiles_path
      pinverse
      pixel_shuffle
      pixel_unshuffle
      platform
      poisson
      poisson_nll_loss
      polar
      polygamma
      pow
      prelu
      prepare_multiprocessing_environment
      preserve_format
      prev_error_mode
      prod
      profiler
      promote_types
      py_dll_path
      q_per_channel_axis
      q_per_channel_scales
      q_per_channel_zero_points
      q_scale
      q_zero_point
      qint32
      qint8
      qr
      qscheme
      quantile
      quantization
      quantize_per_channel
      quantize_per_tensor
      quantized_batch_norm
      quantized_gru
      quantized_gru_cell
      quantized_lstm
      quantized_lstm_cell
      quantized_max_pool1d
      quantized_max_pool2d
      quantized_rnn_relu_cell
      quantized_rnn_tanh_cell
      quasirandom
      quint4x2
      quint8
      rad2deg
      rad2deg_
      rand
      rand_like
      randint
      randint_like
      randn
      randn_like
      random
      randperm
      range
      ravel
      real
      reciprocal
      reciprocal_
      relu
      relu_
      remainder
      renorm
      repeat_interleave
      res
      reshape
      resize_as_
      result_type
      rnn_relu
      rnn_relu_cell
      rnn_tanh
      rnn_tanh_cell
      roll
      rot90
      round
      round_
      row_stack
      rrelu
      rrelu_
      rsqrt
      rsqrt_
      rsub
      saddmm
      save
      scalar_tensor
      scatter
      scatter_add
      searchsorted
      seed
      select
      selu
      selu_
      serialization
      set_anomaly_enabled
      set_autocast_enabled
      set_default_dtype
      set_default_tensor_type
      set_deterministic
      set_flush_denormal
      set_grad_enabled
      set_num_interop_threads
      set_num_threads
      set_printoptions
      set_rng_state
      sgn
      short
      sigmoid
      sigmoid_
      sign
      signbit
      sin
      sin_
      sinc
      sinc_
      sinh
      sinh_
      slogdet
      smm
      softmax
      solve
      sort
      sparse
      sparse_coo
      sparse_coo_tensor
      split
      split_with_sizes
      spmm
      sqrt
      sqrt_
      square
      square_
      squeeze
      sspaddmm
      stack
      std
      std_mean
      stft
      storage
      strided
      sub
      subtract
      sum
      svd
      svd_lowrank
      swapaxes
      swapdims
      symeig
      sys
      t
      take
      tan
      tan_
      tanh
      tanh_
      tensor
      tensor_split
      tensordot
      testing
      textwrap
      th_dll_path
      threshold
      threshold_
      tile
      topk
      torch
      trace
      transpose
      trapz
      triangular_solve
      tril
      tril_indices
      triplet_margin_loss
      triu
      triu_indices
      true_divide
      trunc
      trunc_
      typename
      types
      uint8
      unbind
      unify_type_list
      unique
      unique_consecutive
      unsafe_chunk
      unsafe_split
      unsafe_split_with_sizes
      unsqueeze
      use_deterministic_algorithms
      utils
      vander
      var
      var_mean
      vdot
      version
      view_as_complex
      view_as_real
      vstack
      wait
      warnings
      where
      with_load_library_flags
      xlogy
      xlogy_
      zero_
      zeros
      zeros_like
      
      

      要查看 PyTorch 中特定函数的用法,可以使用 help() 函数,如下所示:

      import torch
      
      # 查看torch中add函数的用法
      help(torch.add)
      

      这将打印出 torch.add 函数的帮助文档,包括函数的参数、返回值、用法示例等。您也可以在 Jupyter Notebook 或 IPython 中使用 ? 符号来查看帮助文档,如下所示:

      import torch
      
      # 查看torch中add函数的用法
      torch.add?
      

      这将显示与上面 help(torch.add) 相同的帮助文档。

      Output exceeds the size limit. Open the full output data in a text editor
      Docstring:
      add(input, other, *, out=None)
      
      Adds the scalar :attr:`other` to each element of the input :attr:`input`
      and returns a new resulting tensor.
      
      .. math::
          \text{out} = \text{input} + \text{other}
      
      If :attr:`input` is of type FloatTensor or DoubleTensor, :attr:`other` must be
      a real number, otherwise it should be an integer.
      
      Args:
          input (Tensor): the input tensor.
          value (Number): the number to be added to each element of :attr:`input`
      
      Keyword arguments:
          out (Tensor, optional): the output tensor.
      
      Example::
      
          >>> a = torch.randn(4)
          >>> a
          tensor([ 0.0202,  1.0985,  1.3506, -0.6056])
          >>> torch.add(a, 20)
      ...
                  [-18.6971, -18.0736, -17.0994, -17.3216],
                  [ -6.7845,  -6.1610,  -5.1868,  -5.4090],
                  [ -8.9902,  -8.3667,  -7.3925,  -7.6147]])
      Type:      builtin_function_or_method
      
      版权声明:本文内容来自第三方投稿或授权转载,原文地址:https://blog.51cto.com/guog/6207009,作者:guog算法笔记,版权归原作者所有。本网站转在其作品的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如因作品内容、版权等问题需要同本网站联系,请发邮件至ctyunbbs@chinatelecom.cn沟通。

      上一篇:#云原生征文#K8s集群流量暴露的几种方案

      下一篇:Unix/Linux环境下多一点不如少一点

      相关文章

      2025-04-14 09:24:23

      python打印宝塔代码

      python打印宝塔代码

      2025-04-14 09:24:23
      python
      2025-04-09 09:16:56

      python四种抽样方法的使用:随机抽样、聚类抽样、系统抽样、分层抽样

      python四种抽样方法的使用:随机抽样、聚类抽样、系统抽样、分层抽样

      2025-04-09 09:16:56
      python , 代码 , 方法 , 机器学习 , 示例
      2025-04-09 09:16:42

      视频 | Python测试开发之调试print代码实例

      视频 | Python测试开发之调试print代码实例

      2025-04-09 09:16:42
      debug , log4j , logback , logging , python
      2025-04-09 09:16:42

      python简单介绍及基础知识(一)

      编程语言,是用来实现某种功能的编写给计算机读取和执行的语言

      2025-04-09 09:16:42
      print , python , 下划线 , 变量 , 变量名 , 编程语言 , 语言
      2025-04-09 09:16:00

      使用Python扩展PAM(part 2)

      在上篇part1 中编译的pam_python.so可以用Python代码进行一些额外的验证操作。动态密码,虚拟账号,都是可行的,只要编写的python鉴权脚本符合相应的PAM规范即可使用。

      2025-04-09 09:16:00
      python , 使用 , 密码 , 配置
      2025-04-09 09:13:27

      1行Python代码,把Excel转成PDF,python-office功能更新~

      1行Python代码,把Excel转成PDF,python-office功能更新~

      2025-04-09 09:13:27
      Excel , pdf , python , 代码 , 程序员
      2025-04-09 09:13:17

      python性能测试之pyperformance

      python性能测试之pyperformance

      2025-04-09 09:13:17
      json , python , Python , 性能 , 文档 , 测试
      2025-04-09 09:13:17

      IronPython 与 c# 交互之导入Python模块的两种方法

      当我们要在C#中调用python时,有时候需要用到python里的一些函数,比如进行一些数学运算,开方,取对数,这个时候我们需要用到python里的math模块(类似C#的命名空间,但概念不完全一样).

      2025-04-09 09:13:17
      python , 函数 , 导入 , 方法 , 模块
      2025-04-07 10:28:48

      一篇文章带你剖析Python 字节流处理神器struct

      一篇文章带你剖析Python 字节流处理神器struct

      2025-04-07 10:28:48
      python
      2025-04-07 10:28:48

      如何把一个python列表(有很多个元素)变成一个excel表格的第一列?

      如何把一个python列表(有很多个元素)变成一个excel表格的第一列?

      2025-04-07 10:28:48
      python , 数据
      查看更多
      推荐标签

      作者介绍

      天翼云小翼
      天翼云用户

      文章

      33561

      阅读量

      5255232

      查看更多

      最新文章

      【python基础】学习路线

      2025-03-11 09:34:18

      python实战三:使用循环while模拟用户登录

      2025-02-13 08:28:59

      python递归遍历路径下的所有文件和文件夹

      2025-02-11 09:36:57

      仅用pygame+python实现植物大战僵尸-----完成比完美更重要

      2024-12-11 06:14:38

      Flask 实现用户登录功能的完整示例:前端与后端整合(附Demo)

      2024-12-10 07:14:31

      python——偏函数的使用

      2024-11-25 09:16:33

      查看更多

      热门文章

      python list转dict

      2023-04-18 14:16:25

      定义一个函数,接收三个参数返回一元二次方程

      2023-02-13 07:59:59

      python 倒排索引(Inverted Index)

      2023-04-18 14:16:25

      python取两个列表的并集、交集、差集

      2023-04-18 14:17:22

      解决numpy报错UFuncTypeError: Cannot cast ufunc ‘add‘ output from dtype(‘x‘) to dtype(‘x‘)

      2023-04-18 14:17:10

      python使用xlwt创建与保存excel文件

      2023-04-18 14:17:10

      查看更多

      热门标签

      linux java python javascript 数组 前端 docker Linux vue 函数 shell git 节点 容器 示例
      查看更多

      相关产品

      弹性云主机

      随时自助获取、弹性伸缩的云服务器资源

      天翼云电脑(公众版)

      便捷、安全、高效的云电脑服务

      对象存储

      高品质、低成本的云上存储服务

      云硬盘

      为云上计算资源提供持久性块存储

      查看更多

      随机文章

      scikit-learn学习基础知识四

      django-pycharm下省略python manage.py的办法

      python——快速排序实现

      找出两数组的不同

      python turtle module 总结一(基本)

      python之输入和输出

      • 7*24小时售后
      • 无忧退款
      • 免费备案
      • 专家服务
      售前咨询热线
      400-810-9889转1
      关注天翼云
      • 旗舰店
      • 天翼云APP
      • 天翼云微信公众号
      服务与支持
      • 备案中心
      • 售前咨询
      • 智能客服
      • 自助服务
      • 工单管理
      • 客户公告
      • 涉诈举报
      账户管理
      • 管理中心
      • 订单管理
      • 余额管理
      • 发票管理
      • 充值汇款
      • 续费管理
      快速入口
      • 天翼云旗舰店
      • 文档中心
      • 最新活动
      • 免费试用
      • 信任中心
      • 天翼云学堂
      云网生态
      • 甄选商城
      • 渠道合作
      • 云市场合作
      了解天翼云
      • 关于天翼云
      • 天翼云APP
      • 服务案例
      • 新闻资讯
      • 联系我们
      热门产品
      • 云电脑
      • 弹性云主机
      • 云电脑政企版
      • 天翼云手机
      • 云数据库
      • 对象存储
      • 云硬盘
      • Web应用防火墙
      • 服务器安全卫士
      • CDN加速
      热门推荐
      • 云服务备份
      • 边缘安全加速平台
      • 全站加速
      • 安全加速
      • 云服务器
      • 云主机
      • 智能边缘云
      • 应用编排服务
      • 微服务引擎
      • 共享流量包
      更多推荐
      • web应用防火墙
      • 密钥管理
      • 等保咨询
      • 安全专区
      • 应用运维管理
      • 云日志服务
      • 文档数据库服务
      • 云搜索服务
      • 数据湖探索
      • 数据仓库服务
      友情链接
      • 中国电信集团
      • 189邮箱
      • 天翼企业云盘
      • 天翼云盘
      ©2025 天翼云科技有限公司版权所有 增值电信业务经营许可证A2.B1.B2-20090001
      公司地址:北京市东城区青龙胡同甲1号、3号2幢2层205-32室
      • 用户协议
      • 隐私政策
      • 个人信息保护
      • 法律声明
      备案 京公网安备11010802043424号 京ICP备 2021034386号