Library API¶
Welcome to the developer reference for the PyTorch C++ API.
Class Hierarchy¶
-
- Namespace at
- Namespace at::native
- Struct ActivationDescriptor
- Struct ConvolutionDescriptor
- Struct CTCLossDescriptor
- Template Struct DescriptorDeleter
- Struct DftiDescriptorDeleter
- Struct DropoutDescriptor
- Struct RNNDescriptor
- Struct SpatialTransformerDescriptor
- Template Class Descriptor
- Class DftiDescriptor
- Class FilterDescriptor
- Class RNNDataDescriptor
- Class TensorDescriptor
- Union Constant
- Class OptionalTensorRef
- Class Tensor
- Class TensorRef
- Namespace at::native
- Namespace c10
- Namespace c10::cuda
- Struct CUDAGuard
- Struct CUDAMultiStreamGuard
- Struct CUDAStreamGuard
- Struct OptionalCUDAGuard
- Struct OptionalCUDAStreamGuard
- Class CUDAStream
- Namespace c10::ivalue
- Struct ComplexHolder
- Struct StreamData3Holder
- Namespace c10::WarningUtils
- Struct WarnAlways
- Class WarningHandlerGuard
- Namespace c10::xpu
- Class XPUStream
- Struct Capsule
- Template Struct complex< Half >
- Struct Device
- Template Struct ExclusivelyOwnedTraits< at::Tensor >
- Struct Half
- Struct Half::from_bits_t
- Struct IValue
- Struct IValue::CompAliasedIValues
- Struct IValue::CompIdentityIValues
- Struct IValue::HashAliasedIValue
- Struct IValue::HashIdentityIValue
- Template Struct IValue::TagType
- Union IValue::Payload
- Template Struct MaybeOwnedTraits< at::Tensor >
- Template Struct OptionalArray
- Struct StrongTypePtr
- Struct WeakIValue
- Struct WeakOrStrongCompilationUnit
- Struct WeakOrStrongTypePtr
- Struct WeakTypePtr
- Template Class ArrayRef
- Template Class Dict
- Class DistBackendError
- Class DistError
- Class DistNetworkError
- Class DistStoreError
- Class EnforceFiniteError
- Class Error
- Class ErrorAlwaysShowCppStacktrace
- Template Class IListRef
- Class IndexError
- Class LinAlgError
- Template Class List
- Class NotImplementedError
- Class OnnxfiBackendSystemError
- Template Class OptionalArrayRef
- Class OutOfMemoryError
- Class TypeError
- Class ValueError
- Class Warning
- Class Warning::DeprecationWarning
- Class Warning::UserWarning
- Class WarningHandler
- Enum DeviceType
- Namespace c10::cuda
- Namespace torch
- Namespace torch::autograd
- Namespace torch::autograd::detail
- Struct MakeNextFunctionList
- Struct AutogradContext
- Template Struct CppNode
- Struct ExtractVariables
- Template Struct Function
- Struct Node
- Struct Node::undefined_input
- Struct TraceableFunction
- Struct TypeAndSize
- Class NodeGuard
- Namespace torch::autograd::detail
- Namespace torch::data
- Namespace torch::data::datasets
- Namespace torch::data::datasets::detail
- Template Struct is_optional
- Template Struct is_optional< optional< T > >
- Template Class BatchDataBuffer
- Struct ChunkDatasetOptions
- Struct TensorDataset
- Template Class BatchDataset
- Template Class ChunkDataReader
- Template Class ChunkDataset
- Template Class Dataset
- Template Class MapDataset
- Class MNIST
- Template Class SharedBatchDataset
- Template Class StatefulDataset
- Namespace torch::data::datasets::detail
- Namespace torch::data::detail
- Namespace torch::data::detail::sequencers
- Template Struct NoSequencer
- Template Struct OrderedSequencer
- Template Struct Sequencer
- Template Struct SentinelIterator
- Template Struct ValidIterator
- Template Class DataShuttle
- Template Class Queue
- Namespace torch::data::detail::sequencers
- Namespace torch::data::samplers
- Struct BatchSize
- Struct CustomBatchRequest
- Class DistributedRandomSampler
- Template Class DistributedSampler
- Class DistributedSequentialSampler
- Class RandomSampler
- Template Class Sampler
- Class SequentialSampler
- Class StreamSampler
- Namespace torch::data::transforms
- Template Struct Normalize
- Template Struct Stack
- Template Struct Stack< Example<> >
- Template Struct Stack< TensorExample >
- Template Class BatchLambda
- Template Class BatchTransform
- Template Class Lambda
- Template Class TensorLambda
- Template Class TensorTransform
- Template Class Transform
- Struct DataLoaderOptions
- Template Struct Example
- Template Struct Example< Data, example::NoTarget >
- Struct FullDataLoaderOptions
- Struct WorkerException
- Template Class DataLoaderBase
- Struct DataLoaderBase::Job
- Struct DataLoaderBase::QuitWorker
- Struct DataLoaderBase::Result
- Struct DataLoaderBase::Sequenced
- Template Class Iterator
- Template Class StatefulDataLoader
- Template Class StatelessDataLoader
- Namespace torch::data::datasets
- Namespace torch::detail
- Class ClassNotSelected
- Template Class SelectiveStr
- Class TorchLibraryInit
- Namespace torch::enumtype
- Struct _compute_enum_name
- Struct kArea
- Struct kBatchMean
- Struct kBicubic
- Struct kBilinear
- Struct kBorder
- Struct kCircular
- Struct kConstant
- Struct kConv1D
- Struct kConv2D
- Struct kConv3D
- Struct kConvTranspose1D
- Struct kConvTranspose2D
- Struct kConvTranspose3D
- Struct kFanIn
- Struct kFanOut
- Struct kGELU
- Struct kGRU
- Struct kLeakyReLU
- Struct kLinear
- Struct kLSTM
- Struct kMax
- Struct kMean
- Struct kMish
- Struct kNearest
- Struct kNearestExact
- Struct kNone
- Struct kReflect
- Struct kReflection
- Struct kReLU
- Struct kReplicate
- Struct kRNN_RELU
- Struct kRNN_TANH
- Struct kSame
- Struct kSigmoid
- Struct kSiLU
- Struct kSum
- Struct kTanh
- Struct kTrilinear
- Struct kValid
- Struct kZeros
- Namespace torch::jit
- Namespace torch::jit::detail
- Struct AttributePolicy
- Struct BufferPolicy
- Struct ModulePolicy
- Template Struct NamedPolicy
- Struct ParameterPolicy
- Struct SlotCursor
- Enum FusionBehavior
- Struct Module
- Template Struct Named
- Struct RegisterOperators
- Template Struct slot_iterator_impl
- Template Struct slot_list_impl
- Namespace torch::jit::detail
- Namespace torch::nn
- Namespace torch::nn::detail
- Template Struct ConvNdOptions
- Struct RNNCellOptionsBase
- Struct RNNOptionsBase
- Template Class _DropoutNd
- Template Class RNNCellImplBase
- Template Class RNNImplBase
- Namespace torch::nn::functional
- Struct AlphaDropoutFuncOptions
- Struct BatchNormFuncOptions
- Template Struct ConvFuncOptions
- Template Struct ConvTransposeFuncOptions
- Struct DropoutFuncOptions
- Struct EmbeddingBagFuncOptions
- Struct EmbeddingFuncOptions
- Struct FeatureAlphaDropoutFuncOptions
- Struct GridSampleFuncOptions
- Struct GroupNormFuncOptions
- Struct GumbelSoftmaxFuncOptions
- Struct InstanceNormFuncOptions
- Struct InterpolateFuncOptions
- Struct LayerNormFuncOptions
- Struct LogSoftmaxFuncOptions
- Template Struct MaxUnpoolFuncOptions
- Struct MultiheadAttentionForwardFuncOptions
- Struct NormalizeFuncOptions
- Struct PadFuncOptions
- Struct RReLUFuncOptions
- Struct SoftmaxFuncOptions
- Struct SoftminFuncOptions
- Namespace torch::nn::functions
- Class CrossMapLRN2d
- Namespace torch::nn::utils
- Namespace torch::nn::utils::rnn
- Class PackedSequence
- Namespace torch::nn::utils::rnn
- Template Struct AdaptiveAvgPoolOptions
- Struct AdaptiveLogSoftmaxWithLossOptions
- Template Struct AdaptiveMaxPoolOptions
- Template Struct AnyModuleHolder
- Struct AnyModulePlaceholder
- Struct ASMoutput
- Template Struct AvgPoolOptions
- Struct BatchNormOptions
- Struct BCELossOptions
- Struct BCEWithLogitsLossOptions
- Struct BilinearOptions
- Struct CELUOptions
- Template Struct ConstantPadOptions
- Template Struct ConvOptions
- Template Struct ConvTransposeOptions
- Struct CosineEmbeddingLossOptions
- Struct CosineSimilarityOptions
- Struct CrossEntropyLossOptions
- Struct CrossMapLRN2dOptions
- Struct CTCLossOptions
- Struct DropoutOptions
- Struct ELUOptions
- Struct EmbeddingBagFromPretrainedOptions
- Struct EmbeddingBagOptions
- Struct EmbeddingFromPretrainedOptions
- Struct EmbeddingOptions
- Struct FlattenOptions
- Struct FoldOptions
- Template Struct FractionalMaxPoolOptions
- Struct GELUOptions
- Struct GLUOptions
- Struct GroupNormOptions
- Struct GRUCellOptions
- Struct GRUOptions
- Struct HardshrinkOptions
- Struct HardtanhOptions
- Struct HingeEmbeddingLossOptions
- Struct HuberLossOptions
- Struct InstanceNormOptions
- Struct KLDivLossOptions
- Struct L1LossOptions
- Struct LayerNormOptions
- Struct LeakyReLUOptions
- Struct LinearOptions
- Struct LocalResponseNormOptions
- Struct LogSoftmaxOptions
- Template Struct LPPoolOptions
- Struct LSTMCellOptions
- Struct LSTMOptions
- Struct MarginRankingLossOptions
- Template Struct MaxPoolOptions
- Template Struct MaxUnpoolOptions
- Struct MSELossOptions
- Struct MultiheadAttentionOptions
- Struct MultiLabelMarginLossOptions
- Struct MultiLabelSoftMarginLossOptions
- Struct MultiMarginLossOptions
- Struct NLLLossOptions
- Struct PairwiseDistanceOptions
- Struct PixelShuffleOptions
- Struct PixelUnshuffleOptions
- Struct PoissonNLLLossOptions
- Struct PReLUOptions
- Template Struct ReflectionPadOptions
- Struct ReLU6Options
- Struct ReLUOptions
- Template Struct ReplicationPadOptions
- Struct RNNCellOptions
- Struct RNNOptions
- Struct RReLUOptions
- Struct SELUOptions
- Struct SmoothL1LossOptions
- Struct SoftMarginLossOptions
- Struct SoftmaxOptions
- Struct SoftminOptions
- Struct SoftplusOptions
- Struct SoftshrinkOptions
- Struct ThresholdOptions
- Struct TransformerDecoderLayerOptions
- Struct TransformerDecoderOptions
- Struct TransformerEncoderLayerOptions
- Struct TransformerEncoderOptions
- Struct TransformerOptions
- Struct TripletMarginLossOptions
- Struct TripletMarginWithDistanceLossOptions
- Struct UnflattenOptions
- Struct UnfoldOptions
- Struct UpsampleOptions
- Template Struct ZeroPadOptions
- Class AdaptiveAvgPool1d
- Class AdaptiveAvgPool2d
- Class AdaptiveAvgPool3d
- Class AdaptiveLogSoftmaxWithLoss
- Class AdaptiveMaxPool1d
- Class AdaptiveMaxPool2d
- Class AdaptiveMaxPool3d
- Class AlphaDropout
- Class AnyModule
- Class AnyValue
- Template Struct AnyValue::Holder
- Struct AnyValue::Placeholder
- Class AvgPool1d
- Class AvgPool2d
- Class AvgPool3d
- Class BatchNorm1d
- Class BatchNorm2d
- Class BatchNorm3d
- Template Class BatchNormImplBase
- Class BCELoss
- Class BCEWithLogitsLoss
- Class Bilinear
- Class CELU
- Template Class Cloneable
- Class ConstantPad1d
- Class ConstantPad2d
- Class ConstantPad3d
- Class Conv1d
- Class Conv2d
- Class Conv3d
- Class ConvTranspose1d
- Class ConvTranspose2d
- Class ConvTranspose3d
- Class CosineEmbeddingLoss
- Class CosineSimilarity
- Class CrossEntropyLoss
- Class CrossMapLRN2d
- Class CTCLoss
- Class Dropout
- Class Dropout2d
- Class Dropout3d
- Class ELU
- Class Embedding
- Class EmbeddingBag
- Class FeatureAlphaDropout
- Class Flatten
- Class Fold
- Class FractionalMaxPool2d
- Class FractionalMaxPool3d
- Class Functional
- Class GELU
- Class GLU
- Class GroupNorm
- Class GRU
- Class GRUCell
- Class Hardshrink
- Class Hardtanh
- Class HingeEmbeddingLoss
- Class HuberLoss
- Class Identity
- Class InstanceNorm1d
- Class InstanceNorm2d
- Class InstanceNorm3d
- Class KLDivLoss
- Class L1Loss
- Class LayerNorm
- Class LeakyReLU
- Class Linear
- Class LocalResponseNorm
- Class LogSigmoid
- Class LogSoftmax
- Class LPPool1d
- Class LPPool2d
- Class LPPool3d
- Class LSTM
- Class LSTMCell
- Class MarginRankingLoss
- Class MaxPool1d
- Class MaxPool2d
- Class MaxPool3d
- Class MaxUnpool1d
- Class MaxUnpool2d
- Class MaxUnpool3d
- Class Mish
- Class Module
- Class ModuleDict
- Template Class ModuleHolder
- Class ModuleList
- Class MSELoss
- Class MultiheadAttention
- Class MultiLabelMarginLoss
- Class MultiLabelSoftMarginLoss
- Class MultiMarginLoss
- Class NamedAnyModule
- Class NLLLoss
- Template Class NormImplBase
- Class PairwiseDistance
- Class ParameterDict
- Class ParameterList
- Class PixelShuffle
- Class PixelUnshuffle
- Class PoissonNLLLoss
- Class PReLU
- Class ReflectionPad1d
- Class ReflectionPad2d
- Class ReflectionPad3d
- Class ReLU
- Class ReLU6
- Class ReplicationPad1d
- Class ReplicationPad2d
- Class ReplicationPad3d
- Class RNN
- Class RNNCell
- Class RReLU
- Class SELU
- Class Sequential
- Class Sigmoid
- Class SiLU
- Class SmoothL1Loss
- Class SoftMarginLoss
- Class Softmax
- Class Softmax2d
- Class Softmin
- Class Softplus
- Class Softshrink
- Class Softsign
- Class Tanh
- Class Tanhshrink
- Class Threshold
- Class Transformer
- Class TransformerDecoder
- Class TransformerDecoderLayer
- Class TransformerEncoder
- Class TransformerEncoderLayer
- Class TripletMarginLoss
- Class TripletMarginWithDistanceLoss
- Class Unflatten
- Class Unfold
- Class Upsample
- Class ZeroPad1d
- Class ZeroPad2d
- Class ZeroPad3d
- Namespace torch::nn::detail
- Namespace torch::optim
- Struct AdagradOptions
- Struct AdagradParamState
- Struct AdamOptions
- Struct AdamParamState
- Struct AdamWOptions
- Struct AdamWParamState
- Struct LBFGSOptions
- Struct LBFGSParamState
- Struct RMSpropOptions
- Struct RMSpropParamState
- Struct SGDOptions
- Struct SGDParamState
- Class Adagrad
- Class Adam
- Class AdamW
- Class LBFGS
- Class LRScheduler
- Class Optimizer
- Template Class OptimizerCloneableOptions
- Template Class OptimizerCloneableParamState
- Class OptimizerOptions
- Class OptimizerParamGroup
- Class OptimizerParamState
- Class ReduceLROnPlateauScheduler
- Class RMSprop
- Class SGD
- Class StepLR
- Namespace torch::serialize
- Class InputArchive
- Class OutputArchive
- Template Struct InitLambda
- Template Class class_
- Class CppFunction
- Class CustomClassHolder
- Template Class ExpandingArray
- Template Class ExpandingArrayWithOptionalElem
- Class IMethod
- Class Library
- Template Class OrderedDict
- Class OrderedDict::Item
- Enum _RegisterOrVerify
- Namespace torch::autograd
- Union TriviallyCopyablePayload
- Namespace at
File Hierarchy¶
-
- Directory aten
- Directory src
- Directory ATen
- Directory core
- File ivalue.h
- File ScalarType.h
- File Tensor.h
- Directory cuda
- File CUDAContext.h
- Directory cudnn
- File Descriptors.h
- File Handles.h
- File Types.h
- File Utils.h
- Directory mkl
- File Descriptors.h
- Directory native
- File TensorShape.h
- File ATen.h
- File Backend.h
- File DeviceGuard.h
- File Layout.h
- File Scalar.h
- File TensorOptions.h
- Directory core
- Directory ATen
- Directory src
- Directory build
- Directory aten
- Directory src
- Directory ATen
- Directory core
- File TensorBody.h
- File Functions.h
- Directory core
- Directory ATen
- Directory src
- Directory aten
- Directory c10
- Directory core
- File Device.h
- File DeviceType.h
- Directory cuda
- File CUDAGuard.h
- File CUDAStream.h
- Directory util
- File ArrayRef.h
- File Exception.h
- File Half.h
- File Optional.h
- File OptionalArrayRef.h
- Directory xpu
- File XPUStream.h
- Directory core
- Directory torch
- Directory csrc
- Directory api
- Directory include
- Directory torch
- Directory data
- Directory dataloader
- File base.h
- File stateful.h
- File stateless.h
- Directory datasets
- Directory detail
- File data_shuttle.h
- File queue.h
- File sequencers.h
- Directory samplers
- File base.h
- File custom_batch_request.h
- File distributed.h
- File random.h
- File sequential.h
- File serialize.h
- File stream.h
- Directory transforms
- File dataloader.h
- File dataloader_options.h
- File datasets.h
- File example.h
- File iterator.h
- File samplers.h
- File transforms.h
- File worker_exception.h
- Directory dataloader
- Directory nn
- Directory functional
- File activation.h
- File batchnorm.h
- File conv.h
- File distance.h
- File dropout.h
- File embedding.h
- File fold.h
- File instancenorm.h
- File linear.h
- File loss.h
- File normalization.h
- File padding.h
- File pixelshuffle.h
- File pooling.h
- File upsampling.h
- File vision.h
- Directory modules
- Directory container
- File any.h
- File any_module_holder.h
- File any_value.h
- File functional.h
- File moduledict.h
- File modulelist.h
- File named_any.h
- File parameterdict.h
- File parameterlist.h
- File sequential.h
- File _functions.h
- File activation.h
- File adaptive.h
- File batchnorm.h
- File common.h
- File conv.h
- File distance.h
- File dropout.h
- File embedding.h
- File fold.h
- File instancenorm.h
- File linear.h
- File loss.h
- File normalization.h
- File padding.h
- File pixelshuffle.h
- File pooling.h
- File rnn.h
- File transformer.h
- File transformercoder.h
- File transformerlayer.h
- File upsampling.h
- File utils.h
- Directory container
- Directory options
- File activation.h
- File adaptive.h
- File batchnorm.h
- File conv.h
- File distance.h
- File dropout.h
- File embedding.h
- File fold.h
- File instancenorm.h
- File linear.h
- File loss.h
- File normalization.h
- File padding.h
- File pixelshuffle.h
- File pooling.h
- File rnn.h
- File transformer.h
- File transformercoder.h
- File transformerlayer.h
- File upsampling.h
- File vision.h
- Directory parallel
- File data_parallel.h
- Directory utils
- File clip_grad.h
- File convert_parameters.h
- File rnn.h
- File cloneable.h
- File functional.h
- File init.h
- File module.h
- File modules.h
- File options.h
- File pimpl.h
- File utils.h
- Directory functional
- Directory optim
- Directory schedulers
- File lr_scheduler.h
- File reduce_on_plateau_scheduler.h
- File step_lr.h
- File adagrad.h
- File adam.h
- File adamw.h
- File lbfgs.h
- File optimizer.h
- File rmsprop.h
- File serialize.h
- File sgd.h
- Directory schedulers
- Directory python
- File init.h
- Directory serialize
- File archive.h
- File input-archive.h
- File output-archive.h
- File tensor.h
- File all.h
- File arg.h
- File autograd.h
- File cuda.h
- File data.h
- File enum.h
- File expanding_array.h
- File fft.h
- File imethod.h
- File jit.h
- File linalg.h
- File mps.h
- File nested.h
- File nn.h
- File optim.h
- File ordered_dict.h
- File python.h
- File serialize.h
- File sparse.h
- File special.h
- File torch.h
- File types.h
- File utils.h
- File xpu.h
- Directory data
- Directory torch
- Directory include
- Directory autograd
- Directory generated
- File variable_factories.h
- File autograd.h
- File custom_function.h
- File function.h
- File variable.h
- Directory generated
- Directory jit
- Directory api
- File module.h
- Directory runtime
- File custom_operator.h
- Directory serialization
- File import.h
- Directory api
- Directory api
- File custom_class.h
- File library.h
- Directory csrc
- Directory aten