[ 
https://issues.apache.org/jira/browse/MAHOUT-725?focusedWorklogId=998541&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-998541
 ]

ASF GitHub Bot logged work on MAHOUT-725:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Jan/26 14:04
            Start Date: 03/Jan/26 14:04
    Worklog Time Spent: 10m 
      Work Description: rich7420 commented on code in PR #763:
URL: https://github.com/apache/mahout/pull/763#discussion_r2658939535


##########
qdp/qdp-python/src/lib.rs:
##########
@@ -215,6 +246,40 @@ impl QdpEngine {
         })
     }
 
+    /// Encode from PyTorch Tensor
+    ///
+    /// Args:
+    ///     tensor: PyTorch Tensor (must be on CPU)
+    ///     num_qubits: Number of qubits for encoding
+    ///     encoding_method: Encoding strategy
+    ///
+    /// Returns:
+    ///     QuantumTensor: DLPack-compatible tensor
+    fn encode_tensor(
+        &self,
+        tensor: &Bound<'_, PyAny>,
+        num_qubits: usize,
+        encoding_method: &str,
+    ) -> PyResult<QuantumTensor> {
+        validate_tensor(tensor)?;
+
+        // Convert to flat list for encoding
+        let data: Vec<f64> = tensor
+            .call_method0("flatten")?
+            .call_method0("tolist")?
+            .extract()?;

Review Comment:
   It seems here do twice copy.
   ```
   PyTorch tensor → Python list
   Python list → Rust Vec<f64>
   ```
   We should improve this in follow-up PR use like numpy() or 
`PinnedHostBuffer` way to decrease memory copy time.
   Please comments in this part.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 998541)
    Time Spent: 2h 20m  (was: 2h 10m)

> Where is org.apache.mahout.cf.taste.impl.model.jdbc in v0.6?
> ------------------------------------------------------------
>
>                 Key: MAHOUT-725
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-725
>             Project: Mahout
>          Issue Type: Question
>    Affects Versions: 0.6
>            Reporter: Daniel Xiaodan Zhou
>            Assignee: Sean R. Owen
>            Priority: Major
>              Labels: gsoc2011
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Hello, I'm working on a GSoC2011 project which is to integrate Mahout into 
> Drupal to provide content recommender services. I'm now considering whether 
> to use the JDBCDataModel provided by Mahout, or retrieve data into memory 
> myself and user GenericDataModel. I see 
> org.apache.mahout.cf.taste.impl.model.jdbc is missing in Mahout v0.6. If 
> JDBCDataModel is removed in future release of Mahout, I'll just ignore it. 
> Any suggestions? Thanks!  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to