Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

created bilstm dropout condition #769

Closed
Closed
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
3 changes: 2 additions & 1 deletion pytext/models/representations/bilstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def forward(
Shape of each state is (bsize x num_layers * num_directions x nhid).

"""
embedded_tokens = self.dropout(embedded_tokens)
if self.dropout.p > 0.0:
embedded_tokens = self.dropout(embedded_tokens)

if states is not None:
# convert (h0, c0) from (bsz x num_layers*num_directions x nhid) to
Expand Down