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

Fix to word_language_model/word_language_model.py for python3 compatibility #70

Merged
merged 1 commit into from
Nov 30, 2019
Merged
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
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