Initiliaze dataDim_t with nvinfer1::Dims

This commit is contained in:
oren
2020-12-05 16:52:47 -06:00
parent 86478f9384
commit 714d0685a9
2 changed files with 9 additions and 10 deletions
+5
View File
@@ -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) {};