ryankert01 commented on code in PR #1407:
URL: https://github.com/apache/mahout/pull/1407#discussion_r3448688895


##########
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:
   This cast now affects `QuantumDataLoader.source_file()` too, because the 
Python loader factories build file pipelines with `Dtype::Float32` and there is 
no public loader dtype option. That makes f64 file input narrow by default for 
f32-capable encodings. Is that the behavior we want? If so, I think it should 
be called out in the loader docs, and ideally exposed as an explicit loader 
setting.



-- 
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