viiccwen commented on code in PR #1000:
URL: https://github.com/apache/mahout/pull/1000#discussion_r2751386574


##########
qdp/qdp-python/src/lib.rs:
##########
@@ -1038,20 +1112,193 @@ impl QdpEngine {
             consumed: false,
         })
     }
+
+    /// Create a synthetic-data loader iterator for use in Python `for qt in 
loader`.
+    ///
+    /// Yields one QuantumTensor (batch) per iteration; releases GIL during 
encode.
+    /// Use with QuantumDataLoader builder or directly for streaming encode.
+    ///
+    /// Args:
+    ///     total_batches: Number of batches to yield
+    ///     batch_size: Samples per batch
+    ///     num_qubits: Qubits per sample
+    ///     encoding_method: "amplitude", "angle", or "basis"
+    ///     seed: Optional RNG seed for reproducible synthetic data
+    ///
+    /// Returns:
+    ///     PyQuantumLoader: iterator yielding QuantumTensor per __next__
+    #[cfg(target_os = "linux")]
+    #[pyo3(signature = (total_batches, batch_size=64, num_qubits=16, 
encoding_method="amplitude", seed=None))]
+    fn create_synthetic_loader(
+        &self,
+        total_batches: usize,
+        batch_size: usize,
+        num_qubits: u32,
+        encoding_method: &str,
+        seed: Option<u64>,
+    ) -> PyResult<PyQuantumLoader> {
+        let config = PipelineConfig {
+            device_id: 0,
+            num_qubits,
+            batch_size,
+            total_batches,
+            encoding_method: encoding_method.to_string(),
+            seed,
+            warmup_batches: 0,
+        };

Review Comment:
   device_id uses hard-coded 0, config should equals to use actually.



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