Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Member Functions
caffe2::ArgumentHelper Class Reference

A helper class to index into arguments. More...

#include <proto_utils.h>

Public Member Functions

 ArgumentHelper (const OperatorDef &def)
 
 ArgumentHelper (const NetDef &netdef)
 
bool HasArgument (const string &name) const
 
template<typename T >
T GetSingleArgument (const string &name, const T &default_value) const
 
template<typename T >
bool HasSingleArgumentOfType (const string &name) const
 
template<typename T >
vector< TGetRepeatedArgument (const string &name, const std::vector< T > &default_value=std::vector< T >()) const
 
template<typename MessageType >
MessageType GetMessageArgument (const string &name) const
 
template<typename MessageType >
vector< MessageType > GetRepeatedMessageArgument (const string &name) const
 
template<>
C10_EXPORT bool RemoveArgument (OperatorDef &def, int index)
 
template<>
bool RemoveArgument (NetDef &def, int index)
 

Static Public Member Functions

template<typename Def >
static bool HasArgument (const Def &def, const string &name)
 
template<typename Def , typename T >
static T GetSingleArgument (const Def &def, const string &name, const T &default_value)
 
template<typename Def , typename T >
static bool HasSingleArgumentOfType (const Def &def, const string &name)
 
template<typename Def , typename T >
static vector< TGetRepeatedArgument (const Def &def, const string &name, const std::vector< T > &default_value=std::vector< T >())
 
template<typename Def , typename MessageType >
static MessageType GetMessageArgument (const Def &def, const string &name)
 
template<typename Def , typename MessageType >
static vector< MessageType > GetRepeatedMessageArgument (const Def &def, const string &name)
 
template<typename Def >
static bool RemoveArgument (Def &def, int index)
 

Detailed Description

A helper class to index into arguments.

This helper helps us to more easily index into a set of arguments that are present in the operator. To save memory, the argument helper does not copy the operator def, so one would need to make sure that the lifetime of the OperatorDef object outlives that of the ArgumentHelper.

Definition at line 200 of file proto_utils.h.


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