Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
caffe2::OperatorBase Class Reference
Inheritance diagram for caffe2::OperatorBase:
caffe2::Observable< OperatorBase > caffe2::Caffe2ModuleTestDynamicDummyOp caffe2::mkl::MKLOperator< T > caffe2::Operator< Context > caffe2::PrefetchOperator< Context > caffe2::Operator< CPUContext > caffe2::Operator< CUDAContext > caffe2::AbstractLengthsGradientOp< T, TLengths, Context, ReducerGradient, GradientNeedIndices > caffe2::AbstractLengthsOp< TData, TLengths, Context, Reducer, SparseFused, InputAccessor > caffe2::AbstractLengthsWithMainInputAndForwardOutputGradientOp< T, TLengths, Context, ReducerGradient > caffe2::AbstractLengthsWithMainInputGradientOp< T, TLengths, Context, ReducerGradient, SparseFused, GradientNeedIndices > caffe2::AbstractReduceFrontOrBackGradientOp< T, Context, ReducerGradient, FirstDim > caffe2::AbstractReduceFrontOrBackOp< T, Context, Reducer, FirstDim, InputAccessor > caffe2::AbstractSortedSegmentGradientOp< T, SIndex, Context, ReducerGradient > caffe2::AbstractSortedSegmentOp< T, SIndex, Context, Reducer, SparseFused, InputAccessor > caffe2::AbstractSortedSegmentRangeGradientOp< T, SIndex, Context, RangeReducerGradient > caffe2::AbstractSortedSegmentRangeOp< T, SIndex, Context, RangeReducer, InputAccessor > caffe2::AbstractUnsortedSegmentGradientOp< T, SIndex, Context, ReducerGradient > caffe2::AbstractUnsortedSegmentOp< T, SIndex, Context, Reducer, SparseFused, InputAccessor > caffe2::AccumulateHistogramOp< T, Context > caffe2::AccumulateInputGradientOp< Context > caffe2::AccumulateOp< T, Context > caffe2::AccuracyOp< T, Context > caffe2::AdagradOp< T, Context > caffe2::AdamOp< T, Context > caffe2::AddPaddingOp< Context > caffe2::AffineChannelGradientOp< T, Context > caffe2::AffineChannelOp< T, Context > caffe2::AliasOp< Context > caffe2::APMeterOp< T, Context > caffe2::AssertOp< Context > caffe2::AtomicIterOp< Context > caffe2::BatchBoxCoxOp< Context > caffe2::BatchBucketOneHotOp< Context > caffe2::BatchDenseToSparseOp< T, Context > caffe2::BatchGatherGradientOp< Context > caffe2::BatchGatherOp< Context > caffe2::BatchMatMulOp< Context, Engine > caffe2::BatchOneHotOp< Context > caffe2::BatchPermutationGradientOp< T, Context > caffe2::BatchPermutationOp< T, Context > caffe2::BatchSparseToDenseOp< T, Context > caffe2::BBoxTransformOp< T, Context > caffe2::BinaryElementwiseOp< InputTypes, Context, Functor, TypeMap > caffe2::BooleanMaskOp< Context > caffe2::BooleanUnmaskOp< Context > caffe2::BoxWithNMSLimitOp< Context > caffe2::CastOp< Context > caffe2::ChannelBackpropStatsOp< Context > caffe2::ChannelStatsOp< Context > caffe2::CheckCounterDoneOp< T, Context > caffe2::CheckpointOp< Context > caffe2::ClipGradientOp< T, Context > caffe2::ClipOp< T, Context > caffe2::CloseBlobsQueueOp< Context > caffe2::Col2ImOp< T, Context > caffe2::ConcatOp< Context > caffe2::ConditionalOp< Context > caffe2::ConvPoolOpBase< Context > caffe2::ConvTransposeUnpoolBase< Context > caffe2::CopyOp< Context, DstContext, SrcContext > caffe2::CosineEmbeddingCriterionGradientOp< Context > caffe2::CosineEmbeddingCriterionOp< Context > caffe2::CosineSimilarityGradientOp< T, Context > caffe2::CosineSimilarityOp< T, Context > caffe2::CountDownOp< T, Context > caffe2::CountUpOp< T, Context > caffe2::CreateBlobsQueueOp< Context > caffe2::CreateCounterOp< T, Context > caffe2::CreateDBOp< Context > caffe2::CreateMapOp< Context > caffe2::CreateScopeOp< Context > caffe2::CrossEntropyGradientOp< T, Context > caffe2::CrossEntropyOp< T, Context > caffe2::DBExistsOp< Context > caffe2::DequeueBlobsOp< Context > caffe2::DivGradientOp< Context > caffe2::DoOp< Context > caffe2::DotProductGradientOp< T, Context > caffe2::DotProductOp< T, Context > caffe2::DotProductWithPaddingGradientOp< T, Context > caffe2::DotProductWithPaddingOp< T, Context > caffe2::DropoutGradientOp< T, Context > caffe2::DropoutOp< T, Context > caffe2::ElementwiseLinearGradientOp< T, Context, Engine > caffe2::ElementwiseLinearOp< T, Context, Engine > caffe2::EluGradientOp< T, Context > caffe2::EluOp< T, Context > caffe2::EnqueueBlobsOp< Context > caffe2::EnsureDenseOp< Context > caffe2::ExpandDimsOp< Context > caffe2::FeedBlobOp< Context > caffe2::FileStoreHandlerCreateOp< Context > caffe2::FillerOp< Context > caffe2::FindDuplicateElementsOp< Context > caffe2::FindOp< Context > caffe2::FlattenOp< Context > caffe2::FlattenToVecOp< Context > caffe2::FlexibleTopKGradientOp< T, Context > caffe2::FlexibleTopKOp< T, Context > caffe2::FloatToFused8BitRowwiseQuantizedOp< Context > caffe2::FloatToHalfOp< Context > caffe2::FloatToRowwiseQuantized8BitsOp< Context > caffe2::FP16MomentumSGDUpdateOp< T, Context > caffe2::FP32MomentumSGDUpdateOp< T, Context > caffe2::FreeOp< Context > caffe2::FtrlOp< T, Context > caffe2::FullyConnectedDecompGradientOp< T, Context, Engine > caffe2::FullyConnectedGradientOp< Context, Engine, TransposeWeight > caffe2::FullyConnectedOp< Context, Engine, TransposeWeight > caffe2::FullyConnectedOp_SPARSE< T, Context, Engine > caffe2::FullyConnectedOpDecomp< T, Context, Engine > caffe2::FullyConnectedOpPrune< T, Context, Engine > caffe2::FullyConnectedPruneGradientOp< T, Context, Engine > caffe2::FunHashGradientOp< T, Context > caffe2::FunHashOp< T, Context > caffe2::Fused8BitRowwiseQuantizedToFloatOp< Context > caffe2::GatherOp< Context > caffe2::GatherPaddingOp< Context > caffe2::GatherRangesOp< Context > caffe2::GatherRangesToDenseOp< Context > caffe2::GenerateProposalsOp< Context > caffe2::GluOp< T, Context > caffe2::GroupSpatialSoftmaxGradientOp< T, Context > caffe2::GroupSpatialSoftmaxOp< T, Context > caffe2::GRUUnitGradientOp< T, Context > caffe2::GRUUnitOp< T, Context > caffe2::HalfToFloatOp< Context > caffe2::HasElementsOp< Context > caffe2::HasScopeOp< Context > caffe2::HSoftmaxOpBase< T, Context > caffe2::HuffmanTreeHierarchyOp< T, Context > caffe2::IfOp< Context > caffe2::Im2ColOp< T, Context > caffe2::IndexHashOp< Context > caffe2::InstanceNormGradientOp< T, Context > caffe2::InstanceNormOp< T, Context > caffe2::IsEmptyOp< Context > caffe2::IsMemberOfOp< Context > caffe2::IterOp< Context > caffe2::KeySplitOp< T, Context > caffe2::KeyValueToMapOp< Context > caffe2::L1DistanceGradientOp< T, Context > caffe2::L1DistanceOp< T, Context > caffe2::LabelCrossEntropyGradientOp< T, Context > caffe2::LabelCrossEntropyOp< T, Context > caffe2::LambdaRankNdcgGradientOp< T, Context > caffe2::LambdaRankNdcgOp< T, Context > caffe2::LayerNormGradientOp< Context > caffe2::LayerNormOp< Context > caffe2::LeakyReluGradientOp< T, Context > caffe2::LeakyReluOp< T, Context > caffe2::LearningRateOp< T, Context > caffe2::LengthsGatherOp< Context > caffe2::LengthsRangeFillOp< Context > caffe2::LengthsTileOp< Context > caffe2::LengthsTopKGradientOp< T, Context > caffe2::LengthsTopKOp< T, Context > caffe2::LengthsToRangesOp< Context > caffe2::LengthsToSegmentIdsOp< Context > caffe2::LengthsToShapeOp< Context > caffe2::LengthsToWeightsOp< Context > caffe2::LoadOp< Context > caffe2::LogitGradientOp< T, Context > caffe2::LpNormGradientOp< T, Context > caffe2::LpNormOp< T, Context > caffe2::LRNOpBase< T, Context > caffe2::LSTMUnitGradientOp< Context > caffe2::LSTMUnitOp< Context > caffe2::MakeTwoClassGradientOp< T, Context > caffe2::MakeTwoClassOp< T, Context > caffe2::MapToKeyValueOp< Context > caffe2::MarginRankingCriterionGradientOp< Context > caffe2::MarginRankingCriterionOp< Context > caffe2::MatMulOp< T, Context, Engine > caffe2::MaxMinOpBase< T, Context > caffe2::MaxReduceDimsGradientOp< T, Context, FIRSTDIMS > caffe2::MaxReduceDimsOp< T, Context, FIRSTDIMS > caffe2::MaxReductionGradientOp< T, Context, ROWWISE > caffe2::MaxReductionOp< T, Context, ROWWISE > caffe2::MergeDimOp< Context > caffe2::MergeIdListsOp< Context > caffe2::ModOp< Context > caffe2::MomentumSGDOp< T, Context > caffe2::MomentumSGDUpdateOp< T, Context > caffe2::MultiClassAccuracyOp< T, Context > caffe2::NanCheckOp< Context > caffe2::NCHW2NHWCOp< T, Context > caffe2::NegateGradientOp< Context > caffe2::NGramFromCategoricalOp< F, T, Context > caffe2::NHWC2NCHWOp< T, Context > caffe2::NoDefaultEngineOp< Context > caffe2::NormalizeGradientOp< T, Context > caffe2::NormalizeL1Op< T, Context > caffe2::NormalizeOp< T, Context > caffe2::OneHotOp< Context > caffe2::ONNXWhileOp< Context > caffe2::PackRNNSequenceOpBase< Context, Forward > caffe2::PackSegmentsOp< Context > caffe2::PadEmptySamplesOp< Context > caffe2::PairWiseLossGradientOp< T, Context > caffe2::PairWiseLossOp< T, Context > caffe2::PercentileOp< Context > caffe2::PerplexityOp< T, Context > caffe2::PiecewiseLinearTransformOp< T, Context > caffe2::PReluGradientOp< T, Context > caffe2::PReluOp< T, Context > caffe2::PrependDimOp< Context > caffe2::PrintOp< Context > caffe2::PSRoIPoolGradientOp< T, Context > caffe2::PSRoIPoolOp< T, Context > caffe2::RangeOp< Context > caffe2::RecurrentNetworkBlobFetcherOp< Context > caffe2::RecurrentNetworkGradientOp< Context > caffe2::RecurrentNetworkOp< Context > caffe2::RedisStoreHandlerCreateOp< Context > caffe2::ReduceTailSumOp< T, Context > caffe2::ReluGradientOp< T, Context > caffe2::ReluOp< T, Context > caffe2::RemoveDataBlocksOp< Context > caffe2::RemovePaddingOp< Context > caffe2::ReplaceNaNOp< Context > caffe2::ResetCounterOp< T, Context > caffe2::ReshapeOp< F, Context > caffe2::ResizeLikeOp< Context > caffe2::ResizeNearestGradientOp< T, Context > caffe2::ResizeNearestOp< T, Context > caffe2::RetrieveCountOp< T, Context > caffe2::ReversePackedSegsOp< Context > caffe2::RMACRegionsOp< Context > caffe2::RmsPropOp< T, Context > caffe2::RNNApplyLinkOp< Context > caffe2::RoIAlignGradientOp< T, Context > caffe2::RoIAlignOp< T, Context > caffe2::RoIPoolFGradientOp< T, Context > caffe2::RoIPoolFOp< T, Context > caffe2::RoIPoolGradientOp< T, Context > caffe2::RoIPoolOp< T, Context > caffe2::RowMulOp< T, Context > caffe2::Rowwise8BitQuantizedToFloatOp< Context > caffe2::RowWiseSparseAdagradOp< T, Context > caffe2::RowWiseSparseAdamOp< T, Context > caffe2::SafeDequeueBlobsOp< Context > caffe2::SafeEnqueueBlobsOp< Context > caffe2::SampleAsGradientOp< T, Context > caffe2::SampleAsOp< T, Context > caffe2::SaveOp< Context > caffe2::ScaleOp< Context > caffe2::ScatterAssignOp< Context > caffe2::ScatterWeightedSumOp< T, Context > caffe2::SegmentIdsToLengthsOp< Context > caffe2::SegmentIdsToRangesOp< Context > caffe2::SelectGradientOpBase< T, Context > caffe2::SelectSmoothL1LossGradientOp< T, Context > caffe2::SelectSmoothL1LossOp< T, Context > caffe2::SeluGradientOp< T, Context > caffe2::SeluOp< T, Context > caffe2::SequenceMaskOp< Context > caffe2::ShapeOp< Context > caffe2::SigmoidCrossEntropyLossGradientOp< T, Context > caffe2::SigmoidCrossEntropyLossOp< T, Context > caffe2::SigmoidCrossEntropyWithLogitsGradientOp< T, Context > caffe2::SigmoidCrossEntropyWithLogitsOp< T, Context > caffe2::SigmoidFocalLossGradientOp< T, Context > caffe2::SigmoidFocalLossOp< T, Context > caffe2::SinusoidPositionEncodingOp< Context > caffe2::SizeOp< Context > caffe2::SliceGradientOp< SIndex, Context > caffe2::SliceOp< SIndex, Context > caffe2::SmoothL1LossGradientOp< T, Context > caffe2::SmoothL1LossOp< T, Context > caffe2::SoftmaxFocalLossGradientOp< T, Context > caffe2::SoftmaxFocalLossOp< T, Context > caffe2::SoftmaxGradientOp< T, Context > caffe2::SoftmaxOp< T, Context > caffe2::SoftmaxWithLossGradientOp< T, Context > caffe2::SoftmaxWithLossOp< T, Context > caffe2::SoftplusGradientOp< T, Context > caffe2::SoftplusOp< T, Context > caffe2::SpaceBatchOpBase< Context > caffe2::SparseAdagradOp< T, Context > caffe2::SparseAdamOp< T, Context > caffe2::SparseFunHashGradientOp< T, Context > caffe2::SparseFunHashOp< T, Context > caffe2::SparseLengths8BitsRowwiseOp< Context, USE_WEIGHTS, USE_MEAN, OutDataT > caffe2::SparseLengthsFused8BitRowwiseOp< Context, with_weights, is_mean > caffe2::SparseMatrixReshapeOp< Context > caffe2::SparseMomentumSGDUpdateOp< T, Context > caffe2::SparseNormalizeOp< T, Context > caffe2::SparseToDenseMaskBase< Context > caffe2::SparseToDenseOp< Context > caffe2::SpatialBNGradientOp< Context > caffe2::SpatialBNOp< Context > caffe2::SpatialNarrowAsGradientOp< Context > caffe2::SpatialNarrowAsOp< Context > caffe2::SpatialSoftmaxWithLossGradientOp< T, Context > caffe2::SpatialSoftmaxWithLossOp< T, Context > caffe2::SplitOp< Context > caffe2::SquaredL2DistanceGradientOp< T, Context > caffe2::SquaredL2DistanceOp< T, Context > caffe2::SquareRootDivideOp< Context > caffe2::SqueezeOp< Context > caffe2::StopGradientOp< Context > caffe2::StringJoinOp< Context > caffe2::SumElementsGradientOp< T, Context > caffe2::SumElementsOp< T, Context > caffe2::SummarizeOp< T, Context > caffe2::SumOp< Context > caffe2::SumReduceDimsGradientOp< Context, FIRSTDIMS, NORMALIZE > caffe2::SumReduceDimsOp< Context, FIRSTDIMS, NORMALIZE > caffe2::SumReduceLikeOp< Context > caffe2::SumSqrElementsOp< Context > caffe2::SwishGradientOp< Context > caffe2::ThresholdedReluGradientOp< T, Context > caffe2::ThresholdedReluOp< T, Context > caffe2::TileGradientOp< T, Context > caffe2::TileOp< Context > caffe2::TopKGradientOp< T, Context > caffe2::TopKOp< T, Context > caffe2::TransposeOp< Context > caffe2::TTContractionGradientOp< T, Context, Engine > caffe2::TTContractionOp< T, Context, Engine > caffe2::TTLinearGradientOp< T, Context, Engine > caffe2::TTLinearOp< T, Context, Engine > caffe2::TTPadGradientOp< T, Context, Engine > caffe2::TTPadOp< T, Context, Engine > caffe2::UnaryElementwiseWithArgsOp< InputTypes, Context, Functor, TypeMap > caffe2::UniqueOp< Context > caffe2::UnpackSegmentsOp< Context > caffe2::UnsafeCoalesceOp< Context > caffe2::UpsampleNearestGradientOp< T, Context > caffe2::UpsampleNearestOp< T, Context > caffe2::WallClockTimeOp< Context > caffe2::WeightedSampleDequeueBlobsOp< Context > caffe2::WeightedSampleOp< T, Context > caffe2::WeightedSigmoidCrossEntropyWithLogitsGradientOp< T, Context > caffe2::WeightedSigmoidCrossEntropyWithLogitsOp< T, Context > caffe2::WeightedSumGradientOp< Context > caffe2::WeightedSumOp< Context > caffe2::WhereOp< Context > caffe2::WhileOp< Context > caffe2::YellowFinOp< T, Context > caffe2::ZeroGradientOp< Context > caffe2::ImageInputOp< Context > caffe2::TensorProtosDBInput< Context > caffe2::VideoInputOp< Context > caffe2::BRGNCHWCToPackedInt8BGRAStylizerDeprocessOp caffe2::CloseRebatchingQueueOp caffe2::CopyFromOpenGLOp< T > caffe2::CopyToOpenGLOp< T > caffe2::CPUSparseLengthsReductionOp< T, InputTypes, USE_WEIGHT, USE_MEAN > caffe2::CpuUtilizationReportOp caffe2::CreateRebatchingQueueOp caffe2::CreateTextFileReaderOp caffe2::db::CreateBlobsQueueDBOp< Context > caffe2::DequeueRebatchingQueueOp caffe2::EnqueueRebatchingQueueOp caffe2::Float16ConstantFillOp caffe2::GatherByKeyOp caffe2::GLNormPlanarYUVOp< T > caffe2::IndexCreateOp< T > caffe2::IndexFreezeOp caffe2::IndexGetOp caffe2::IndexLoadOp caffe2::IndexSizeOp caffe2::IndexStoreOp caffe2::OpenGLAddOp< T > caffe2::OpenGLConcatOp< T > caffe2::OpenGLInstanceNormPReluOp< T, FUSE_PRELU > caffe2::OpenGLMulOp< T > caffe2::OpenGLPReluOp< T, reluType > caffe2::OpenGLResizeNearestOp< T > caffe2::OpenGLSigmoidOp< T, opType > caffe2::OpenGLSubOp< T > caffe2::OpenGLTensorToTextureStylizerPreprocessOp caffe2::OpenGLTextureToTensorStylizerDeprocessOp caffe2::OpenGLTextureToTextureStylizerDeprocessOp< inputFormat > caffe2::OpenGLTextureToTextureStylizerPreprocessOp< inputFormat > caffe2::PackedInt8BGRANHWCToNCHWCStylizerPreprocessOp caffe2::PartitionOpBase caffe2::QuantDecodeGradientOp caffe2::QuantDecodeOp< QuantDecodeRun > caffe2::QuantDecompZstdOp caffe2::SegmentOneHotOp caffe2::SNPEOp caffe2::SparseFtrlOp< T > caffe2::StatRegistryCreateOp caffe2::StatRegistryExportOp caffe2::StatRegistryUpdateOp caffe2::StoreAddOp caffe2::StoreGetOp caffe2::StoreSetOp caffe2::StoreWaitOp caffe2::TextFileReaderReadOp caffe2::TimerBeginOp caffe2::TimerEndOp caffe2::TimerGetAndEndOp caffe2::TimerGetOp caffe2::ConvPoolOpBase< CPUContext > caffe2::ConvTransposeUnpoolBase< CPUContext > caffe2::CopyOnDeviceLikeOp< CUDAContext, CUDAContext, CUDAContext > caffe2::CuDNNLRNGradientOp caffe2::CuDNNLRNOp caffe2::CuDNNReluGradientOp caffe2::CuDNNReluOp caffe2::CuDNNSoftmaxGradientOp caffe2::CuDNNSoftmaxOp caffe2::CuDNNTransposeOp caffe2::ElementwiseRTCOp caffe2::GPUFallbackOp< CPUOp, SkipOutputCopy > caffe2::RecurrentBaseOp< T > caffe2::ConvPoolOpBase< CUDAContext > caffe2::ConvTransposeUnpoolBase< CUDAContext > caffe2::SpatialBNGradientOp< CUDAContext > caffe2::SpatialBNOp< CUDAContext >

Public Member Functions

 OperatorBase (const OperatorDef &operator_def, Workspace *ws)
 
bool HasArgument (const string &name) const
 Checks if the operator has an argument of the given name.
 
template<typename T >
GetSingleArgument (const string &name, const T &default_value) const
 
template<typename T >
bool HasSingleArgumentOfType (const string &name) const
 
template<typename T >
vector< T > GetRepeatedArgument (const string &name, const vector< T > &default_value={}) const
 
template<typename T >
const T & Input (int idx)
 
template<typename T >
T * Output (int idx)
 
const BlobInputBlob (int idx)
 
BlobOutputBlob (int idx)
 
template<typename T >
bool InputIsType (int idx)
 
template<typename T >
bool OutputIsType (int idx)
 
int InputSize ()
 
int OutputSize ()
 
const vector< const Blob * > & Inputs () const
 
const vector< Blob * > & Outputs ()
 
vector< TensorShape > InputTensorShapes ()
 
virtual void WaitEvent (const Event &ev, int stream_id=-1)
 
void Wait (const OperatorBase &other, int stream_id=-1)
 
virtual void WaitEvents (const std::vector< const Event * > &events, int stream_id=-1)
 
virtual void Finish ()
 
virtual bool Run (int=0)
 
virtual bool HasAsyncPart () const
 
virtual bool SupportsAsyncScheduling () const
 
virtual bool RunAsync (int stream_id=0)
 
virtual void AddRelatedBlobInfo (EnforceNotMet *err)
 
const OperatorDef & debug_def () const
 
void set_debug_def (const std::shared_ptr< const OperatorDef > &operator_def)
 
bool has_debug_def () const
 
void RecordLastFailedOpNetPosition ()
 
int net_position () const
 
void set_net_position (int idx)
 
const DeviceOption & device_option () const
 
const Eventevent () const
 
Eventevent ()
 
void ResetEvent ()
 
void DisableEvent ()
 
bool IsEventDisabled () const
 
virtual bool IsStreamFree (int) const
 
const std::string & type ()
 
void annotate_engine (const std::string &engine)
 
const std::string & engine () const
 
- Public Member Functions inherited from caffe2::Observable< OperatorBase >
const ObserverAttachObserver (std::unique_ptr< Observer > observer)
 
std::unique_ptr< ObserverDetachObserver (const Observer *observer_ptr)
 Returns a unique_ptr to the removed observer. More...
 
virtual size_t NumObservers ()
 
void StartAllObservers ()
 
void StopAllObservers ()
 

Static Public Attributes

static constexpr int kNoNetPositionSet = -1
 

Protected Member Functions

virtual void RecordEvent (const char *err_msg=nullptr)
 
 DISABLE_COPY_AND_ASSIGN (OperatorBase)
 

Protected Attributes

std::unique_ptr< Eventevent_
 
- Protected Attributes inherited from caffe2::Observable< OperatorBase >
std::vector< std::unique_ptr< Observer > > observers_list_
 

Additional Inherited Members

- Public Types inherited from caffe2::Observable< OperatorBase >
using Observer = ObserverBase< OperatorBase >
 

Detailed Description

Definition at line 45 of file operator.h.


The documentation for this class was generated from the following files: