From 105957dcc11e042ae049014e1c68858a655aeef4 Mon Sep 17 00:00:00 2001 From: Danilo Piparo Date: Tue, 10 Oct 2023 14:59:55 +0200 Subject: [PATCH] [TMVA] Use R__ASSERT instead of assert to fix warnings due to an unused variable in non-debug builds. --- tmva/tmva/inc/TMVA/DNN/Architectures/Cpu/CpuTensor.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tmva/tmva/inc/TMVA/DNN/Architectures/Cpu/CpuTensor.h b/tmva/tmva/inc/TMVA/DNN/Architectures/Cpu/CpuTensor.h index d8af9daf05049..8173420bd0033 100644 --- a/tmva/tmva/inc/TMVA/DNN/Architectures/Cpu/CpuTensor.h +++ b/tmva/tmva/inc/TMVA/DNN/Architectures/Cpu/CpuTensor.h @@ -204,7 +204,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor 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(*(this->GetContainer()), GetHSize(), GetWSize()); } @@ -235,7 +235,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor // for compatibility with old tensor (std::vector) TCpuMatrix operator[](size_t i) const { - assert(this->GetMemoryLayout() == MemoryLayout::ColumnMajor ); + R__ASSERT(this->GetMemoryLayout() == MemoryLayout::ColumnMajor ); return At(i).GetMatrix(); } @@ -251,7 +251,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor 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]; } @@ -261,7 +261,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor 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] @@ -272,7 +272,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor 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]; } @@ -280,7 +280,7 @@ class TCpuTensor : public TMVA::Experimental::RTensor 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]