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

Allow passing of kwargs to theano.function. #2358

Merged
merged 8 commits into from Aug 10, 2013

Conversation

moorepants
Copy link
Member

@mrocklin What do you think of this change?

@jrioux
Copy link
Member

jrioux commented Aug 7, 2013

SymPy Bot Summary: ✅ Passed after merging moorepants/unused-arg (8fef999) into master (0bdb41a).
PyPy 2.0.0-beta-1; 2.7.3-final-42: pass
Python 2.7.2-final-0: pass
Python 3.2.1-final-0: pass
Sphinx 1.1.3: pass
Doc Coverage: unchanged
36.065% of functions have doctests (compared to 36.065% in master)
41.552% of functions are imported into Sphinx (compared to 41.552% in master)

@jrioux
Copy link
Member

jrioux commented Aug 7, 2013

SymPy Bot Summary: ✅ Passed after merging moorepants/unused-arg (8fef999) into master (0bdb41a).
PyPy 2.0.0-beta-1; 2.7.3-final-42: pass
Python 2.7.2-final-0: pass
Python 3.2.1-final-0: pass
Sphinx 1.1.3: pass
Doc Coverage: unchanged
36.065% of functions have doctests (compared to 36.065% in master)
41.552% of functions are imported into Sphinx (compared to 41.552% in master)

def test_theano_function_kwargs():
import numpy as np
f = theano_function([x, y, z], [x+y], dim=1, on_unused_input='ignore')
assert np.linalg.norm(f([1, 2], [3, 4], [0, 0]) - np.asarray([4, 6])) < 1e-9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So normally would this raise an error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because on_unsused_input is not an arg for dim_handling().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you can't pass in more values than specified inputs for theano.function.

@mrocklin
Copy link
Member

mrocklin commented Aug 8, 2013

I need to fix my setup before I can test this. Annoyingly travis isn't set up well to test issues related to Theano. We don't install theano in the travis virtual boxes so all tests are skipped and need to be run locally.

@jrioux
Copy link
Member

jrioux commented Aug 10, 2013

SymPy Bot Summary: ✅ Passed after merging moorepants/unused-arg (6ab3bc0) into master (196fdb3).
PyPy 2.0.0-beta-1; 2.7.3-final-42: pass
Python 2.7.2-final-0: pass
Python 3.2.1-final-0: pass
Sphinx 1.1.3: pass
Doc Coverage: unchanged
36.053% of functions have doctests (compared to 36.053% in master)
41.538% of functions are imported into Sphinx (compared to 41.538% in master)

@moorepants
Copy link
Member Author

I think this is good to go.

@mrocklin
Copy link
Member

Seems fine to me. Merging.

mrocklin added a commit that referenced this pull request Aug 10, 2013
Allow passing of kwargs to theano.function.
@mrocklin mrocklin merged commit c422e97 into sympy:master Aug 10, 2013
@asmeurer
Copy link
Member

SymPy Bot Summary: 🔴 Failed after merging moorepants/unused-arg (6ab3bc0) into master (83f1d9d).
@moorepants: Please fix the test failures.
🔴 Python 2.6.8-final-0: fail
🔴 Python 2.7.3-final-0: fail
🔴 PyPy 1.8.0-final-0; 2.7.2-final-42: fail
Python 3.2.3-final-0: pass
🔴 Sphinx 1.1.3: fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants