提交 9724d92a 编写于 作者: F frankwhzhang

fix tagspace gpu num_devices bug

上级 b67db1d9
......@@ -46,4 +46,4 @@ def network(vocab_text_size, vocab_tag_size, emb_dim=10, hid_dim=1000, win_size=
avg_cost = nn.mean(loss_part3)
less = tensor.cast(cf.less_than(cos_neg, cos_pos), dtype='float32')
correct = nn.reduce_sum(less)
return avg_cost, correct, cos_pos
\ No newline at end of file
return avg_cost, correct, cos_pos
......@@ -102,7 +102,7 @@ def train():
if batch_id % args.print_batch == 0:
print("TRAIN --> pass: {} batch_num: {} avg_cost: {}, acc: {}"
.format(pass_idx, (batch_id+10) * batch_size, np.mean(loss_val),
float(np.sum(correct_val)) / batch_size))
float(np.sum(correct_val)) / (args.num_devices*batch_size)))
t1 = time.time()
total_time += t1 - t0
print("epoch:%d num_steps:%d time_cost(s):%f" %
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册