@@ -11,9 +11,9 @@ bool cosineSimEqual(const at::Tensor& computed_tensor, const at::Tensor& gt_tens
11
11
computed_tensor.flatten (), gt_tensor.flatten (), torch::nn::functional::CosineSimilarityFuncOptions ().dim (0 ));
12
12
std::ostringstream ss;
13
13
ss << computed_tensor << std::endl << gt_tensor << std::endl;
14
- LOG_GRAPH (ss.str ());
15
- LOG_GRAPH (std::string (" Cosine Similarity score: " ) + std::to_string (cosine_sim.item <float >()));
16
- LOG_GRAPH (std::string (" Acceptable Threshold: " ) + std::to_string (threshold));
14
+ LOG_DEBUG (ss.str ());
15
+ LOG_DEBUG (std::string (" Cosine Similarity score: " ) + std::to_string (cosine_sim.item <float >()));
16
+ LOG_DEBUG (std::string (" Acceptable Threshold: " ) + std::to_string (threshold));
17
17
18
18
return cosine_sim.item <float >() >= threshold;
19
19
}
@@ -31,14 +31,14 @@ bool almostEqual(const at::Tensor& computed_tensor, const at::Tensor& gt_tensor,
31
31
auto result = diff.abs ().max ().item <float >();
32
32
auto threshold = atol + (rtol * gt_tensor.abs ().max ().item <float >());
33
33
34
- LOG_GRAPH (std::string (" Max Difference: " ) + std::to_string (result));
35
- LOG_GRAPH (std::string (" Acceptable Threshold: " ) + std::to_string (threshold));
34
+ LOG_DEBUG (std::string (" Max Difference: " ) + std::to_string (result));
35
+ LOG_DEBUG (std::string (" Acceptable Threshold: " ) + std::to_string (threshold));
36
36
37
37
return result <= threshold;
38
38
}
39
39
40
40
bool exactlyEqual (const at::Tensor& computed_tensor, const at::Tensor& gt_tensor) {
41
- LOG_GRAPH (computed_tensor << std::endl << gt_tensor << std::endl);
41
+ LOG_DEBUG (computed_tensor << std::endl << gt_tensor << std::endl);
42
42
std::cout << " Max Difference: " << (computed_tensor - gt_tensor).abs ().max ().item <float >() << std::endl;
43
43
44
44
return (computed_tensor - gt_tensor).abs ().max ().item <float >() == 0 .f ;
0 commit comments