Skip to content

Commit

Permalink
Merge pull request #7438 from takagi/fix-example-sentiment-recursive-…
Browse files Browse the repository at this point in the history
…minibatch

Support default dtype in sentiment example's recursive minibatch version
  • Loading branch information
Crissman committed Jun 25, 2019
2 parents e48db81 + 926480d commit 5289f67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/sentiment/train_recursive_minibatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def forward(self, *inputs):
count = 0
correct = 0

stack = self.xp.zeros(
(batch, maxlen * 2, self.n_units), self.xp.float32)
dtype = chainer.get_dtype()
stack = self.xp.zeros((batch, maxlen * 2, self.n_units), dtype)
for i, (word, label) in enumerate(zip(sequences, leaf_labels)):
batch = word.shape[0]
es = self.leaf(word)
Expand Down

0 comments on commit 5289f67

Please sign in to comment.