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

Keyword arguments not supported #247

Open
ezyang opened this issue Sep 27, 2017 · 0 comments
Open

Keyword arguments not supported #247

ezyang opened this issue Sep 27, 2017 · 0 comments

Comments

@ezyang
Copy link
Owner

ezyang commented Sep 27, 2017

In BatchNorm LSTM, keyword arguments are used to pass input/hidden into layers:

    @staticmethod
    def _forward_rnn(cell, input_, length, hx):
        max_time = input_.size(0)
        output = []
        for time in range(max_time):
            if isinstance(cell, BNLSTMCell):
                h_next, c_next = cell(input_=input_[time], hx=hx, time=time)
            else:
                h_next, c_next = cell(input_=input_[time], hx=hx)

If you compile the cell, this does not work, because we don't understand how to deal with kwargs.

One thing that is subtle about fixing this is that you want cell(input_=input) to be equivalent to cell(input); however, if we are interposing on a forward invocation, you don't actually get any of that info. So you'll have to look at the function specification and reverse engineer it. Annoying. But if this shows up in many places we might have to deal with it.

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

No branches or pull requests

1 participant