rok commented on code in PR #50907:
URL: https://github.com/apache/arrow/pull/50907#discussion_r3854623320


##########
python/pyarrow/tensor.pxi:
##########
@@ -871,6 +871,8 @@ shape: {self.shape}"""
         obj : Tensor
             The dense tensor that should be converted.
         """
+        if obj.ndim == 1:
+            obj = Tensor.from_numpy(obj.to_numpy().reshape(1, obj.shape[0]))

Review Comment:
   I want to move these from `from_tensor` to `from_scipy` and only do this if 
we're coming from `scipy.{csc,csr}_matrix` and reject otherwise. `scipy` is 
moving away from allowing 1D input here for a reason.



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