Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TMVA] Use R__ASSERT instead of assert #13831

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tmva/tmva/inc/TMVA/DNN/Architectures/Cpu/CpuTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor<AFloat, TCpuBuffer<AFloat>
ndims++;
}
}
assert(ndims <= 2 && shape.size() > 1); // to support shape cases {n,1}
R__ASSERT(ndims <= 2 && shape.size() > 1); // to support shape cases {n,1}
return TCpuMatrix<AFloat>(*(this->GetContainer()), GetHSize(), GetWSize());
}

Expand Down Expand Up @@ -235,7 +235,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor<AFloat, TCpuBuffer<AFloat>

// for compatibility with old tensor (std::vector<matrix>)
TCpuMatrix<AFloat> operator[](size_t i) const {
assert(this->GetMemoryLayout() == MemoryLayout::ColumnMajor );
R__ASSERT(this->GetMemoryLayout() == MemoryLayout::ColumnMajor );
return At(i).GetMatrix();
}

Expand All @@ -251,7 +251,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor<AFloat, TCpuBuffer<AFloat>
AFloat &operator()(size_t i, size_t j)
{
auto &shape = this->GetShape();
assert(shape.size() == 2);
R__ASSERT(shape.size() == 2);
return (this->GetMemoryLayout() == MemoryLayout::RowMajor) ? (*(this->GetContainer()))[i * shape[1] + j]
: (*(this->GetContainer()))[j * shape[0] + i];
}
Expand All @@ -261,7 +261,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor<AFloat, TCpuBuffer<AFloat>
AFloat &operator()(size_t i, size_t j, size_t k)
{
auto &shape = this->GetShape();
assert(shape.size() == 3);
R__ASSERT(shape.size() == 3);

return (this->GetMemoryLayout() == MemoryLayout::RowMajor)
? (*(this->GetContainer()))[i * shape[1] * shape[2] + j * shape[2] + k]
Expand All @@ -272,15 +272,15 @@ class TCpuTensor : public TMVA::Experimental::RTensor<AFloat, TCpuBuffer<AFloat>
AFloat operator()(size_t i, size_t j) const
{
auto &shape = this->GetShape();
assert(shape.size() == 2);
R__ASSERT(shape.size() == 2);
return (this->GetMemoryLayout() == MemoryLayout::RowMajor) ? (this->GetData())[i * shape[1] + j]
: (this->GetData())[j * shape[0] + i];
}

AFloat operator()(size_t i, size_t j, size_t k) const
{
auto &shape = this->GetShape();
assert(shape.size() == 3);
R__ASSERT(shape.size() == 3);

return (this->GetMemoryLayout() == MemoryLayout::RowMajor)
? (this->GetData())[i * shape[1] * shape[2] + j * shape[2] + k]
Expand Down