Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
datang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaoyunfei
datang
Commits
60ea36a5
Commit
60ea36a5
authored
Aug 27, 2021
by
wanghailong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补全assert注释
parent
4a1866b3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
18 deletions
+27
-18
chunk.cu
yolov3/modules/chunk.cu
+13
-4
detect.cu
yolov3/modules/detect.cu
+3
-3
hardswish.cu
yolov3/modules/hardswish.cu
+4
-4
logging.h
yolov3/modules/logging.h
+3
-3
mish.cu
yolov3/modules/mish.cu
+3
-3
trt_utils.cpp
yolov3/modules/trt_utils.cpp
+1
-1
No files found.
yolov3/modules/chunk.cu
View file @
60ea36a5
...
...
@@ -23,7 +23,10 @@ namespace nvinfer1
}
Chunk::Chunk(const void* buffer, size_t size)
{
assert(size == sizeof(_n_size_split));
//assert(size == sizeof(_n_size_split));
if(size != sizeof(_n_size_split)){
printf("size error!");
}
_n_size_split = *reinterpret_cast<const int*>(buffer);
}
Chunk::~Chunk()
...
...
@@ -37,8 +40,11 @@ namespace nvinfer1
Dims Chunk::getOutputDimensions(int index, const Dims* inputs, int nbInputDims)
{
assert(nbInputDims == 1);
assert(index == 0 || index == 1);
//assert(nbInputDims == 1);
//assert(index == 0 || index == 1);
if(nbInputDims != 1 || index != 0 || index != 1){
printf("output size error!");
}
return Dims3(inputs[0].d[0] / 2, inputs[0].d[1], inputs[0].d[2]);
}
...
...
@@ -111,7 +117,10 @@ namespace nvinfer1
const nvinfer1::DataType* inputTypes,
int nbInputs) const
{
assert(index == 0 || index == 1);
//assert(index == 0 || index == 1);
if(index == 0 || index == 1){
printf("get type error");
}
return DataType::kFLOAT;
}
...
...
yolov3/modules/detect.cu
View file @
60ea36a5
...
...
@@ -34,8 +34,8 @@ namespace nvinfer1
read(d,_n_grid_h);
read(d, _n_grid_w);
read(d, _n_output_size);
//
printf("anchor:%d,classes:%d,gh:%d,gw:%d,size:%d\n", _n_anchor, _n_classes, _n_grid_h, _n_grid_w, _n_output_size);
assert(d == a + length);
printf("anchor:%d,classes:%d,gh:%d,gw:%d,size:%d\n", _n_anchor, _n_classes, _n_grid_h, _n_grid_w, _n_output_size);
//
assert(d == a + length);
}
Detect::Detect(const uint32_t n_anchor_, const uint32_t n_classes_,
...
...
@@ -143,7 +143,7 @@ namespace nvinfer1
write(d, _n_grid_h);
write(d, _n_grid_w);
write(d, _n_output_size);
assert(d == a + getSerializationSize());
//
assert(d == a + getSerializationSize());
}
void Detect::configurePlugin(const PluginTensorDesc* in, int nbInput, const PluginTensorDesc* out, int nbOutput)
...
...
yolov3/modules/hardswish.cu
View file @
60ea36a5
...
...
@@ -35,8 +35,8 @@ namespace nvinfer1
const char *d = reinterpret_cast<const char*>(data), *a = d;
r(d, _n_max_thread_pre_block);
r(d, _n_output_size);
//
printf("r:threads:%d,size:%d\n", _n_max_thread_pre_block, _n_output_size);
assert(d == a + length);
printf("r:threads:%d,size:%d\n", _n_max_thread_pre_block, _n_output_size);
//
assert(d == a + length);
}
Hardswish::~Hardswish()
...
...
@@ -94,8 +94,8 @@ namespace nvinfer1
char *d = static_cast<char*>(buffer), *a = d;
w(d, _n_max_thread_pre_block);
w(d, _n_output_size);
//
printf("serialize:%d,%d\n", _n_max_thread_pre_block, _n_output_size);
assert(d == a + getSerializationSize());
printf("serialize:%d,%d\n", _n_max_thread_pre_block, _n_output_size);
//
assert(d == a + getSerializationSize());
}
void Hardswish::configurePlugin(const PluginTensorDesc* in, int nbInput, const PluginTensorDesc* out, int nbOutput)
...
...
yolov3/modules/logging.h
View file @
60ea36a5
...
...
@@ -319,7 +319,7 @@ public:
static
void
reportTestStart
(
TestAtom
&
testAtom
)
{
reportTestResult
(
testAtom
,
TestResult
::
kRUNNING
);
assert
(
!
testAtom
.
mStarted
);
//
assert(!testAtom.mStarted);
testAtom
.
mStarted
=
true
;
}
...
...
@@ -334,8 +334,8 @@ public:
//!
static
void
reportTestEnd
(
const
TestAtom
&
testAtom
,
TestResult
result
)
{
assert
(
result
!=
TestResult
::
kRUNNING
);
assert
(
testAtom
.
mStarted
);
//
assert(result != TestResult::kRUNNING);
//
assert(testAtom.mStarted);
reportTestResult
(
testAtom
,
result
);
}
...
...
yolov3/modules/mish.cu
View file @
60ea36a5
...
...
@@ -17,7 +17,7 @@ namespace nvinfer1
// create the plugin at runtime from a byte stream
MishPlugin::MishPlugin(const void* data, size_t length)
{
assert(length == sizeof(input_size_));
//
assert(length == sizeof(input_size_));
input_size_ = *reinterpret_cast<const int*>(data);
}
...
...
@@ -38,8 +38,8 @@ namespace nvinfer1
Dims MishPlugin::getOutputDimensions(int index, const Dims* inputs, int nbInputDims)
{
assert(nbInputDims == 1);
assert(index == 0);
//
assert(nbInputDims == 1);
//
assert(index == 0);
input_size_ = inputs[0].d[0] * inputs[0].d[1] * inputs[0].d[2];
// Output dimensions
return Dims3(inputs[0].d[0], inputs[0].d[1], inputs[0].d[2]);
...
...
yolov3/modules/trt_utils.cpp
View file @
60ea36a5
...
...
@@ -398,7 +398,7 @@ std::vector<float> loadWeights(const std::string weightsFilePath, const std::str
while
(
!
file
.
eof
())
{
file
.
read
(
floatWeight
,
4
);
assert
(
file
.
gcount
()
==
4
);
//
assert(file.gcount() == 4);
weights
.
push_back
(
*
reinterpret_cast
<
float
*>
(
floatWeight
));
if
(
file
.
peek
()
==
std
::
istream
::
traits_type
::
eof
())
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment