Refactor coverage report generation

Add some tests to reach 99%
This commit is contained in:
2024-05-06 17:56:00 +02:00
parent 0ec53f405f
commit ced29a2c2e
1091 changed files with 9366 additions and 373937 deletions

View File

@@ -9,7 +9,7 @@
namespace bayesnet {
Node::Node(const std::string& name)
: name(name), numStates(0), cpTable(torch::Tensor()), parents(std::vector<Node*>()), children(std::vector<Node*>())
: name(name)
{
}
void Node::clear()
@@ -96,7 +96,6 @@ namespace bayesnet {
// Get dimensions of the CPT
dimensions.push_back(numStates);
transform(parents.begin(), parents.end(), back_inserter(dimensions), [](const auto& parent) { return parent->getNumStates(); });
// Create a tensor of zeros with the dimensions of the CPT
cpTable = torch::zeros(dimensions, torch::kFloat) + laplaceSmoothing;
// Fill table with counts