Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.activation
Commits
543fbadf
Commit
543fbadf
authored
Feb 26, 2015
by
Manuel Günther
Browse files
Replaced mal-functioning PyNumber_Check with the novel PyBob_NumberCheck.
parent
1108385e
Changes
2
Hide whitespace changes
Inline
Side-by-side
bob/learn/activation/activation.cpp
View file @
543fbadf
...
...
@@ -8,10 +8,11 @@
*/
#define BOB_LEARN_ACTIVATION_MODULE
#include
<bob.learn.activation/api.h>
#include
<bob.io.base/api.h>
#include
<bob.blitz/cppapi.h>
#include
<bob.blitz/cleanup.h>
#include
<bob.extension/defines.h>
#include
<bob.learn.activation/api.h>
#include
<bob.io.base/api.h>
#include
<bob.learn.activation/Activation.h>
#include
<boost/bind.hpp>
#include
<boost/function.hpp>
...
...
@@ -63,7 +64,7 @@ PyObject* PyBobLearnActivation_NewFromActivation
retval
->
cxx
=
a
;
return
reinterpret_cast
<
PyObject
*>
(
retval
);
return
Py_BuildValue
(
"N"
,
retval
);
}
...
...
@@ -174,12 +175,11 @@ static PyObject* PyBobLearnActivation_call1(PyBobLearnActivationObject* self,
return
0
;
}
Py_INCREF
(
res
);
return
PyBlitzArray_NUMPY_WRAP
(
res
);
return
PyBlitzArray_NUMPY_WRAP
(
Py_BuildValue
(
"O"
,
res
));
}
else
if
(
PyNumber
_
Check
(
z
))
{
else
if
(
Py
Bob_
NumberCheck
(
z
))
{
PyObject
*
z_float
=
PyNumber_Float
(
z
);
auto
z_float_
=
make_safe
(
z_float
);
...
...
@@ -251,8 +251,7 @@ static PyObject* PyBobLearnActivation_call2(PyBobLearnActivationObject* self,
return
0
;
}
Py_INCREF
(
res
);
return
PyBlitzArray_NUMPY_WRAP
(
reinterpret_cast
<
PyObject
*>
(
res
));
return
PyBlitzArray_NUMPY_WRAP
(
Py_BuildValue
(
"O"
,
res
));
}
...
...
requirements.txt
View file @
543fbadf
setuptools
bob.extension
bob.extension
>2.0.4
bob.blitz
bob.core
bob.io.base
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment