提交 98bb8ee2 编写于 作者: Q qiaolongfei

fix dim problem

上级 633082ad
...@@ -109,7 +109,10 @@ class DenseScanner(IScanner): ...@@ -109,7 +109,10 @@ class DenseScanner(IScanner):
if len(self.__shape__) > 3: if len(self.__shape__) > 3:
raise ValueError( raise ValueError(
"The dimension of input cannot be greater than 3.") "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
else:
self.__dim__ = reduce(lambda x, y: x * y, self.__shape__)
if len(self.__shape__) == 1 and self.__dim__ != self.input_type.dim: if len(self.__shape__) == 1 and self.__dim__ != self.input_type.dim:
raise ValueError( raise ValueError(
"The data size must be equal to it in data layer.") "The data size must be equal to it in data layer.")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册