Skip to content
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

Fixed buffer protocol example #656

Merged
merged 1 commit into from Jul 17, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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