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


##########
qdp/qdp-core/src/pipeline_runner.rs:
##########
@@ -569,3 +583,42 @@ pub fn run_throughput_pipeline(config: &PipelineConfig) -> 
Result<PipelineRunRes
 pub fn run_latency_pipeline(config: &PipelineConfig) -> 
Result<PipelineRunResult> {
     run_throughput_pipeline(config)
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    fn assert_generate_and_inplace_match(encoding_method: &str) {
+        let config = PipelineConfig {
+            num_qubits: 5,
+            batch_size: 8,
+            encoding_method: encoding_method.to_string(),
+            seed: Some(123),
+            ..Default::default()
+        };
+
+        let vector_len = vector_len(config.num_qubits, 
&config.encoding_method);
+        let batch_idx = 7;

Review Comment:
   we add edge cases like: 0, batch_size-1



##########
qdp/qdp-core/src/pipeline_runner.rs:
##########
@@ -569,3 +583,42 @@ pub fn run_throughput_pipeline(config: &PipelineConfig) -> 
Result<PipelineRunRes
 pub fn run_latency_pipeline(config: &PipelineConfig) -> 
Result<PipelineRunResult> {
     run_throughput_pipeline(config)
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    fn assert_generate_and_inplace_match(encoding_method: &str) {
+        let config = PipelineConfig {
+            num_qubits: 5,
+            batch_size: 8,
+            encoding_method: encoding_method.to_string(),
+            seed: Some(123),
+            ..Default::default()
+        };
+
+        let vector_len = vector_len(config.num_qubits, 
&config.encoding_method);
+        let batch_idx = 7;

Review Comment:
   We can also test if adjacent batch is same of not.
   ```rust
   let batch0 = generate_batch(&config, 0, vector_len);
   let batch1 = generate_batch(&config, 1, vector_len);
   assert_ne!(batch0, batch1);
   ```



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