Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #70 from haojin2/fix_lstm
Browse files Browse the repository at this point in the history
Fix to word_language_model/word_language_model.py for python3 compatibility
  • Loading branch information
larroy authored Nov 30, 2019
2 parents ec72cb7 + 48791e2 commit eadf998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion word_language_model/word_language_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def eval(data_source, ctx):
total_L = 0.0
ntotal = 0
hidden_states = [
model.begin_state(func=mx.nd.zeros, batch_size=args.batch_size/len(ctx), ctx=ctx[i])
model.begin_state(func=mx.nd.zeros, batch_size=int(args.batch_size/len(ctx)), ctx=ctx[i])
for i in range(len(ctx))
]
for i in range(0, data_source.shape[0] - 1, args.bptt):
Expand Down

0 comments on commit eadf998

Please sign in to comment.