Initiliaze dataDim_t with nvinfer1::Dims
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include "utils.h"
|
||||
#include "NvInfer.h"
|
||||
|
||||
namespace tk { namespace dnn {
|
||||
|
||||
@@ -20,6 +21,10 @@ struct dataDim_t {
|
||||
|
||||
dataDim_t() : n(1), c(1), h(1), w(1), l(1) {};
|
||||
|
||||
dataDim_t(nvinfer1::Dims &d) :
|
||||
n(1), c(d.d[0] ? d.d[0] : 1), h(d.d[1] ? d.d[1] : 1),
|
||||
w(d.d[2] ? d.d[2] : 1), l(d.d[3] ? d.d[3] : 1) {};
|
||||
|
||||
dataDim_t(int _n, int _c, int _h, int _w, int _l = 1) :
|
||||
n(_n), c(_c), h(_h), w(_w), l(_l) {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user