yunfengzhou-hub commented on code in PR #163:
URL: https://github.com/apache/flink-ml/pull/163#discussion_r996813015


##########
flink-ml-python/pyflink/ml/core/linalg.py:
##########
@@ -776,3 +777,15 @@ def _double_to_long_bits(value: float) -> int:
         value = float("nan")
     # pack double into 64 bits, then unpack as long int
     return struct.unpack("Q", struct.pack("d", value))[0]
+
+
+parent_from_java_type = typeinfo._from_java_type
+
+
+def _from_java_type(j_type_info: JavaObject):
+    if "GenericType<org.apache.flink.ml.linalg.DenseVector>" == 
str(j_type_info):
+        return DenseVectorTypeInfo()
+    return parent_from_java_type(j_type_info)
+
+
+typeinfo._from_java_type = _from_java_type

Review Comment:
   According to offline discussion, I'll merge the logic related to java type 
here into that defined in `wrapper.py`, and extract the common logic of 
functions into wrapper.py. In this case, all usages of java vector type would 
go through wrapper.py and use the modified version of `_from_java_type()`.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to