-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix dim problem #2636
fix dim problem #2636
Conversation
@@ -109,7 +109,10 @@ def pre_scan(self, dat): | |||
if len(self.__shape__) > 3: | |||
raise ValueError( | |||
"The dimension of input cannot be greater than 3.") | |||
self.__dim__ = reduce(lambda x, y: x * y, self.__shape__) | |||
if len(self.__shape__) == 0: | |||
self.__dim__ = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discuss with @qingqing01 , we think if user configure to use a dence_vector, then the data type should be a vector and shape should not be zero
@@ -109,7 +109,10 @@ def pre_scan(self, dat): | |||
if len(self.__shape__) > 3: | |||
raise ValueError( | |||
"The dimension of input cannot be greater than 3.") | |||
self.__dim__ = reduce(lambda x, y: x * y, self.__shape__) | |||
if len(self.__shape__) == 0: | |||
self.__dim__ = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DenseScanner
must accept the data type dense_vector
. So the dat
in line 108 must be a list ([]
) or numpy.array
. See the input type doc.
The format of input data in issue is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM.
fix #2564
check the input shape of dense_vector.