代码详见SampleCharRNN
1 nvinfer.h中的定义
1.1 处理数据维度的定义
/**
* \class Dims
* \brief structure to define the dimensions of a tensor
*
* \note: currently the following formats are supported for layer inputs and outputs:
* * zero or more index dimensions followed by one channel and two spatial dimensions (e.g. CHW)
* * one time series dimension followed by one index dimension followed by one channel dimension (i.e. TNC)
*/
class Dims
{
public:
static const int MAX_DIMS = 8; //!< the maximum number of dimensions supported for a tensor
int nbDims; //!< the number of dimensions
int d[MAX_DIMS]; //!< the extent of each dimension
DimensionType type[MAX_DIMS]; //!< the type of each dimension
};
1.2 Infer engine中加入PluginLayer