Closed Kaminyou closed 2 years ago
Fix the bug of invalid index of a 0-dim tensor by replacing data[0] to .item(). As:
invalid index of a 0-dim tensor
data[0]
.item()
error = 1. - Y_hat.eq(Y).cpu().float().mean().data[0]
to
error = 1. - Y_hat.eq(Y).cpu().float().mean().data.item()
thanks so much for fixing this!
Fix the bug of
invalid index of a 0-dim tensor
by replacingdata[0]
to.item()
. As:to