deepC icon indicating copy to clipboard operation
deepC copied to clipboard

AttributeError: 'floatTensor' object has no attribute 'sum'

Open handyzeng opened this issue 3 years ago • 2 comments


AttributeError Traceback (most recent call last) in 1 knn = iris_knn() ----> 2 knn.fit() 3 knn.announce()

in fit(self, k) 22 for i in range(len(self.features)): 23 feature = dc.array(self.features[i]) ---> 24 opinion_difference = dc.sqrt(dc.power(dc.sub(feature, self.query),2)).sum() 25 survey.append([opinion_difference, self.labels[i]]) 26

/usr/local/lib/python3.6/dist-packages/deepC/dnnc.py in (self, name) 20866 for _s in [floatplaceHolder]: 20867 swig_getmethods.update(getattr(_s, 'swig_getmethods', {}))

20868 getattr = lambda self, name: _swig_getattr(self, floatTensor, name) 20869 20870 def init(self, *args):

/usr/local/lib/python3.6/dist-packages/deepC/dnnc.py in _swig_getattr(self, class_type, name) 78 if method: 79 return method(self) ---> 80 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.name, name)) 81 82

AttributeError: 'floatTensor' object has no attribute 'sum'

handyzeng avatar Mar 25 '21 04:03 handyzeng

Thank you so much for filing the issue. We will look at it and take appropriate action as soon as possible.' first issue

github-actions[bot] avatar Mar 25 '21 04:03 github-actions[bot]

Hi @handyzeng , can you please attach entire script to reproduce the issue, Thanks!

srohit0 avatar Mar 27 '21 15:03 srohit0