Copilot commented on code in PR #1108:
URL: https://github.com/apache/mahout/pull/1108#discussion_r2881841090


##########
qdp/qdp-python/src/pytorch.rs:
##########
@@ -182,9 +182,18 @@ pub fn validate_cuda_tensor_for_encoding(
                 )));
             }
         }
+        "iqp" | "iqp-z" => {
+            if !dtype_str_lower.contains("float64") {
+                return Err(PyRuntimeError::new_err(format!(
+                    "CUDA tensor must have dtype float64 for {} encoding, got 
{}. \
+                     Use tensor.to(torch.float64)",
+                    method, dtype_str
+                )));
+            }
+        }
         _ => {
             return Err(PyRuntimeError::new_err(format!(
-                "CUDA tensor encoding currently only supports 'amplitude', 
'angle', or 'basis' methods, got '{}'. \
+                "CUDA tensor encoding currently only supports 'amplitude', 
'angle', 'basis', 'iqp', or 'iqp-z' methods, got '{}'. \
                  Use tensor.cpu() to convert to CPU tensor for other encoding 
methods.",
                 encoding_method
             )));

Review Comment:
   The PR title/description focus on fixing misaligned vector loads in batch 
amplitude/norm kernels, but this diff also expands the PyTorch CUDA-tensor 
validation to allow the new user-visible encoding methods 'iqp' and 'iqp-z' 
(and updates the unsupported-method error message accordingly). Please update 
the PR description (and/or title) to explicitly mention this API/behavior 
change so reviewers/users don’t miss it.



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