0lai0 commented on code in PR #1407:
URL: https://github.com/apache/mahout/pull/1407#discussion_r3473389914


##########
qdp/qdp-core/src/pipeline_runner.rs:
##########
@@ -389,28 +428,67 @@ fn path_extension_lower(path: &Path) -> Option<String> {
         .map(|s| s.to_lowercase())
 }
 
-/// Dispatches by path extension to the appropriate io reader. Returns (data, 
num_samples, sample_size).
-/// Unsupported or missing extension returns Err with message listing 
supported formats.
+/// f64→f32 narrowing cast: values outside f32 range silently become ±Inf.
+fn cast_f64_to_batch_data(
+    data: Vec<f64>,
+    n: usize,
+    s: usize,
+    dtype: Precision,
+    fmt: &str,
+) -> (BatchData, usize, usize) {
+    if matches!(dtype, Precision::Float32) {

Review Comment:
   Great catch. I've updated the implementation so that file loads now default 
to f64 for lossless precision, while Float32 is now opt-in via a new public 
.dtype() loader method, where parse_dtype(None) defaults to Float64. Thanks for 
review.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to