Skip to content

Make ConvLSTMCell.__call__ infer the number of features from its input, like the other recurrent cells. #3862

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions flax/linen/recurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,10 @@ def __call__(self, carry, inputs):
A tuple with the new carry and the output.
"""
c, h = carry
features = c.shape[-1]
input_to_hidden = partial(
Conv,
features=4 * self.features,
features=4 * features,
kernel_size=self.kernel_size,
strides=self.strides,
padding=self.padding,
Expand All @@ -842,7 +843,7 @@ def __call__(self, carry, inputs):

hidden_to_hidden = partial(
Conv,
features=4 * self.features,
features=4 * features,
kernel_size=self.kernel_size,
strides=self.strides,
padding=self.padding,
Expand Down