Skip to content

Commit

Permalink
[coverity] Remove no effect code
Browse files Browse the repository at this point in the history
This PR fixes the Coverity issue, indicating no effect code

**Changes proposed in this PR:**
- Remove negative check (unsigned int is always non-negative).

**Self-evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test:   [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Donghyeon Jeong <[email protected]>
  • Loading branch information
djeong20 committed Jan 26, 2024
1 parent 4a7f3c2 commit 96802dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nntrainer/tensor/tensor_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const std::array<size_t, TensorDim::MAXDIM> TensorV2::getStrides() const
}

bool TensorV2::checkContinuous(unsigned int np1, unsigned int np2) const {
if (np1 < 0 || np1 > 3 || np2 < 0 || np2 > 3) {
if (np1 > 3 || np2 > 3) {
throw std::invalid_argument(
"Error: Input value must be within the range of 0 to 3.");
}
Expand Down

0 comments on commit 96802dd

Please sign in to comment.