https://github.com/Open-Deep-ML/DML-OpenProblem/blob/main/questions/46_implement-precision-metric/tests.json
I couldn't find the pytorch test cases for this problem, but the test case 3 expects a precision of 0 to be returned when there are no positive class predictions in the dataset. It should be either 1 or nan (I would go for 1.0).
https://github.com/Open-Deep-ML/DML-OpenProblem/blob/main/questions/46_implement-precision-metric/tests.json
I couldn't find the pytorch test cases for this problem, but the test case 3 expects a precision of 0 to be returned when there are no positive class predictions in the dataset. It should be either 1 or nan (I would go for 1.0).