Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #656 from gsomix/buffer_protocol
Fixed buffer protocol example
  • Loading branch information
Soeren Sonnenburg committed Jul 17, 2012
2 parents feee52c + fc0116a commit b39de77
Showing 1 changed file with 12 additions and 8 deletions.
@@ -1,3 +1,4 @@
import numpy
from shogun.Features import RealFeatures
from shogun.Features import LongIntFeatures

Expand All @@ -15,14 +16,17 @@ def features_dense_real_modular(in_data=data):
f_real=RealFeatures(m_real)
f_long=LongIntFeatures(m_long)

f_real+=m_real
f_long+=m_long
if numpy.__version__ >= 1.5:
f_real+=m_real
f_long+=m_long

f_real*=m_real
f_long*=m_long
f_real*=m_real
f_long*=m_long

f_real-=m_real
f_long-=m_long
f_real-=m_real
f_long-=m_long
else:
print "numpy version >= 1.5 is needed"

f_real+=f_real
f_long+=f_long
Expand All @@ -33,8 +37,8 @@ def features_dense_real_modular(in_data=data):
f_real-=f_real
f_long-=f_long

print f_real
print f_long
# print f_real
# print f_long

try:
mem_real=memoryview(f_real)
Expand Down

0 comments on commit b39de77

Please sign in to comment.