Skip to content

Commit

Permalink
Merge pull request #1052 from dmitriy-serdyuk/scan-args
Browse files Browse the repository at this point in the history
Allow to pass kwargs to scan
  • Loading branch information
dmitriy-serdyuk committed Apr 6, 2016
2 parents b853b57 + a0b04bc commit 063dcdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/bricks/recurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def recurrent_apply(brick, application, application_call,
if not iterate:
return application_function(brick, *args, **kwargs)
reverse = kwargs.pop('reverse', False)
scan_kwargs = kwargs.pop('scan_kwargs', {})
return_initial_states = kwargs.pop('return_initial_states', False)

# Push everything to kwargs
Expand Down Expand Up @@ -227,7 +228,8 @@ def scan_function(*args):
n_steps=n_steps,
go_backwards=reverse,
name='{}_{}_scan'.format(
brick.name, application.application_name))
brick.name, application.application_name),
**scan_kwargs)
result = pack(result)
if return_initial_states:
# Undo Subtensor
Expand Down

0 comments on commit 063dcdb

Please sign in to comment.